Changed StyleMap constructor so that all render intents will be set if only one Style object or symbolizer hash is passed. This is the first patch attached to #1498, which got slightly more votes thaan the second one. r=crschmidt,tschaub (pullup #1498)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6827 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -22,8 +22,8 @@ OpenLayers.StyleMap = OpenLayers.Class({
|
||||
/**
|
||||
* Property: extendDefault
|
||||
* {Boolean} if true, every render intent will extend the symbolizers
|
||||
* specified for the "default" intent. Otherwise, every rendering intent
|
||||
* is treated as a completely independent symbolizer.
|
||||
* specified for the "default" intent at rendering time. Otherwise, every
|
||||
* rendering intent will be treated as a completely independent style.
|
||||
*/
|
||||
extendDefault: true,
|
||||
|
||||
@@ -33,7 +33,9 @@ OpenLayers.StyleMap = OpenLayers.Class({
|
||||
* Parameters:
|
||||
* style - {Object} Optional. Either a style hash, or a style object, or
|
||||
* a hash of style objects (style hashes) keyed by rendering
|
||||
* intent
|
||||
* 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
|
||||
*/
|
||||
@@ -52,6 +54,8 @@ OpenLayers.StyleMap = OpenLayers.Class({
|
||||
if(style instanceof OpenLayers.Style) {
|
||||
// user passed a style object
|
||||
this.styles["default"] = style;
|
||||
this.styles["select"] = style;
|
||||
this.styles["temporary"] = style;
|
||||
} else if(typeof style == "object") {
|
||||
for(var key in style) {
|
||||
if(style[key] instanceof OpenLayers.Style) {
|
||||
@@ -63,6 +67,8 @@ OpenLayers.StyleMap = OpenLayers.Class({
|
||||
} else {
|
||||
// user passed a style hash (i.e. symbolizer)
|
||||
this.styles["default"] = new OpenLayers.Style(style);
|
||||
this.styles["select"] = new OpenLayers.Style(style);
|
||||
this.styles["temporary"] = new OpenLayers.Style(style);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user