"users should be able to customize the select style per feature": Created a !StyleMap class which stores all styles that are needed for a layer. Controls that need to render features differently can now just give a render intent (e.g. "default", "select" or "temporary") to the layer's drawFeature method, instead of having extra style informations like Control.!SelectFeature.selectStyle. Existing application that set layer.style or feature.style are still supported, but both of these style properties are now null by default. r=crschmidt,elemoine,tschaub (closes #1120)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6240 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -43,8 +43,8 @@ OpenLayers.Style = OpenLayers.Class({
|
||||
/**
|
||||
* Property: defaultStyle
|
||||
* {Object} hash of style properties to use as default for merging
|
||||
* rule-based style symbolizers onto. If no rules are defined, createStyle
|
||||
* will return this style.
|
||||
* rule-based style symbolizers onto. If no rules are defined,
|
||||
* createSymbolizer will return this style.
|
||||
*/
|
||||
defaultStyle: null,
|
||||
|
||||
@@ -96,18 +96,17 @@ OpenLayers.Style = OpenLayers.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* APIMethod: createStyle
|
||||
* Method: createSymbolizer
|
||||
* creates a style by applying all feature-dependent rules to the base
|
||||
* style.
|
||||
*
|
||||
* Parameters:
|
||||
* feature - {<OpenLayers.Feature>} feature to evaluate rules for
|
||||
* baseStyle - {Object} hash of styles feature styles to extend
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Feature.Vector.style>} hash of feature styles
|
||||
* {Object} symbolizer hash
|
||||
*/
|
||||
createStyle: function(feature) {
|
||||
createSymbolizer: function(feature) {
|
||||
var style = OpenLayers.Util.extend({}, this.defaultStyle);
|
||||
|
||||
var rules = this.rules;
|
||||
|
||||
Reference in New Issue
Block a user