# OpenLayers.StyleMap

Summary

OpenLayers.StyleMap |
Properties |
styles | Hash of {OpenLayers.Style}, keyed by names of well known rendering intents (e.g.
extendDefault | {Boolean} if true, every render intent will extend the symbolizers specified for the “default” intent at rendering time.
Constructor |
OpenLayers.StyleMap |
Functions |
destroy |
createSymbolizer | Creates the symbolizer for a feature for a render intent.
addUniqueValueRules | Convenience method to create comparison rules for unique values of a property.

### Properties

### styles

Hash of {OpenLayers.Style}, keyed by names of well known rendering intents (e.g. “default”, “temporary”, “select”, “delete”).

### extendDefault

{Boolean} if true, every render intent will extend the symbolizers specified for the “default” intent at rendering time. Otherwise, every rendering intent will be treated as a completely independent style.

### Constructor

### OpenLayers.StyleMap

#### Parameters

style | {Object} Optional. Either a style hash, or a style object, or a hash of style objects (style hashes) keyed by rendering intent. If just one style hash or style object is passed, this will be used for all known render intents (default, select, temporary)
options | {Object} optional hash of additional options for this instance

### Functions

### destroy

> destroy: function()

### createSymbolizer

> createSymbolizer: function( | feature,
> | intent | )

Creates the symbolizer for a feature for a render intent.

#### Parameters

feature | {OpenLayers.Feature} The feature to evaluate the rules of the intended style against.
intent | {String} The intent determines the symbolizer that will be used to draw the feature. Well known intents are “default” (for just drawing the features), “select” (for selected features) and “temporary” (for drawing features).

#### Returns

{Object} symbolizer hash

### addUniqueValueRules

> addUniqueValueRules: function( | renderIntent,
> | property,
> | symbolizers,
> | context | )

Convenience method to create comparison rules for unique values of a property. The rules will be added to the style object for a specified rendering intent. This method is a shortcut for creating something like the “unique value legends” familiar from well known desktop GIS systems

#### Parameters

renderIntent | {String} rendering intent to add the rules to
property | {String} values of feature attributes to create the rules for
symbolizers | {Object} Hash of symbolizers, keyed by the desired property values
context | {Object} An optional object with properties that symbolizers’ property values should be evaluated against. If no context is specified, feature.attributes will be used

This class represents a UserStyle obtained from a SLD, containing styling rules.

> destroy: function()

> createSymbolizer: function( | feature,
> | intent | )

Creates the symbolizer for a feature for a render intent.

> addUniqueValueRules: function( | renderIntent,
> | property,
> | symbolizers,
> | context | )

Convenience method to create comparison rules for unique values of a property.
Features are combinations of geography and attributes.
Close