styleList=paint.ruleset.getStyles(entity,tags,paint.map.scale);
}
+ var suggestedLayer:Number=styleList.layerOverride();
+ if (!isNaN(suggestedLayer)) { layer=suggestedLayer; }
+
var inWay:Boolean=entity.hasParentWays;
var hasStyles:Boolean=styleList.hasStyles();
if (Way(entity).isArea()) { tags[':area']='yes'; }
if (entity.isUneditedTiger() && Globals.vars.highlightTiger) { tags[':tiger']='yes'; }
- // Which layer?
- layer=0;
- if (tags['layer']) { layer=Math.min(Math.max(tags['layer'],paint.minlayer),paint.maxlayer); }
-
// Keep track of maximum stroke width for hitzone
var maxwidth:Number=4;
styleList=paint.ruleset.getStyles(entity, tags, paint.map.scale);
}
+ // Which layer?
+ layer=styleList.layerOverride();
+ if (isNaN(layer)) {
+ layer=0;
+ if (tags['layer']) { layer=Math.min(Math.max(tags['layer'],paint.minlayer),paint.maxlayer); }
+ }
+
// Iterate through each sublayer, drawing any styles on that layer
var drawn:Boolean;
var multis:Array=entity.findParentRelationsOfType('multipolygon','outer');
public var casing_opacity:Number;
public var casing_dashes:Array=[];
+ public var layer:Number; // optional layer override (usually set by OSM tag)
+
override public function get properties():Array {
return [
'width','color','opacity','dashes','linecap','linejoin','line_style',
'fill_color','fill_opacity','fill_image',
- 'casing_width','casing_color','casing_opacity','casing_dashes'
+ 'casing_width','casing_color','casing_opacity','casing_dashes','layer'
];
}
public function hasStyles():Boolean {
return ( hasShapeStyles() || hasTextStyles() || hasPointStyles() || hasShieldStyles() );
}
+
+ public function layerOverride():Number {
+ for each (var ss:ShapeStyle in shapeStyles) {
+ if (ss['layer']) return ss['layer'];
+ }
+ return NaN;
+ }
public function addSublayer(s:Number):void {
if (sublayers.indexOf(s)==-1) { sublayers.push(s); }
relation[type=restriction] node { z-index:11; icon-image: icons/restriction.png; }
node :dupe { z-index: 9; icon-image: circle; icon-width:8; color: white; opacity: 0.4; casing-opacity: 0.4; casing-color: red; casing-width: 3; }
-node :hoverway { z-index: 9; icon-image: square; icon-width: 7; color: blue; }
+node :hoverway { z-index: 9; icon-image: square; icon-width: 7; color: blue; layer: 5; }
node !:drawn :poi { z-index: 2; icon-image: circle; icon-width: 4; color: green; casing-color: black; casing-width: 1; }
node !:drawn :hasTags { z-index: 9; icon-image: circle; icon-width: 4; color: black; }
-node :hasTags :selectedway { z-index: 9; icon-image: square; icon-width: 8; color: black; }
-node !:drawn :selectedway { z-index: 9; icon-image: square; icon-width: 8; color: red; casing-color: #cc0000; casing-width: 1;}
-node :selected { z-index: 1; icon-image: square; icon-width: eval('_width+10'); color: yellow; interactive: no; }
-node :junction :selectedway { z-index: 8; icon-image: square; icon-width: 12; casing-color: black; casing-width: 1; }
+node :hasTags :selectedway { z-index: 9; icon-image: square; icon-width: 8; color: black; layer: 5; }
+node !:drawn :selectedway { z-index: 9; icon-image: square; icon-width: 8; color: red; casing-color: #cc0000; casing-width: 1; layer: 5; }
+node :selected { z-index: 1; icon-image: square; icon-width: eval('_width+10'); color: yellow; interactive: no; layer: 5; }
+node :junction :selectedway { z-index: 8; icon-image: square; icon-width: 12; casing-color: black; casing-width: 1; layer: 5; }
/* Descendant selectors provide an easy way to style relations: this example means "any way
which is part of a relation whose type=route". */