Changeset 3590 in osm for applications
- Timestamp:
- 2007-07-14T23:25:09+02:00 (17 years ago)
- Location:
- applications/editors/josm/plugins/mappaint
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java
r2807 r3590 16 16 { 17 17 boolean inDoc, inRule, inCondition, inElemStyle, inLine, inIcon, inArea; 18 ElemStyle curStyle; 18 ElemStyle curLineStyle=null; 19 ElemStyle curIconStyle=null; 20 ElemStyle curAreaStyle=null; 19 21 ElemStyles styles; 20 22 String curKey, curValue ; … … 140 142 { 141 143 inRule = false; 142 styles.add (curKey, curValue, curStyle); 144 if(curLineStyle != null) 145 { 146 styles.add (curKey, curValue, curLineStyle); 147 curLineStyle = null; 148 } 149 if(curIconStyle != null) 150 { 151 styles.add (curKey, curValue, curIconStyle); 152 curIconStyle = null; 153 } 154 if(curAreaStyle != null) 155 { 156 styles.add (curKey, curValue, curAreaStyle); 157 curAreaStyle = null; 158 } 143 159 } 144 160 else if (inCondition && qName.equals("condition")) … … 147 163 { 148 164 inLine = false; 149 cur Style = new LineElemStyle(curWidth,curRealWidth, curColour,165 curLineStyle = new LineElemStyle(curWidth,curRealWidth, curColour, 150 166 curMinZoom); 151 167 curWidth=1; … … 155 171 { 156 172 inIcon = false; 157 cur Style = new IconElemStyle(curIcon,curAnnotate,curMinZoom);173 curIconStyle = new IconElemStyle(curIcon,curAnnotate,curMinZoom); 158 174 } 159 175 else if (inArea && qName.equals("area")) 160 176 { 161 177 inArea = false; 162 cur Style = new AreaElemStyle (curColour,curMinZoom);178 curAreaStyle = new AreaElemStyle (curColour,curMinZoom); 163 179 } 164 180 -
applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyles.java
r1501 r3590 17 17 { 18 18 String key = k + "=" + v; 19 20 /* unfortunately, there don't seem to be an efficient way to */ 21 /* find out, if a given OsmPrimitive is an area or not, */ 22 /* so distinguish only between way and node here - for now */ 23 if(style instanceof AreaElemStyle) { 24 key = key + "way"; 25 } 26 else if(style instanceof LineElemStyle) { 27 key = key + "way"; 28 } 29 else if(style instanceof IconElemStyle) { 30 key = key + "node"; 31 } 19 32 styles.put(key, style); 20 33 } … … 24 37 if(p.keys!=null) 25 38 { 39 String classname; 40 41 if(p instanceof org.openstreetmap.josm.data.osm.Node) { 42 classname = "node"; 43 } else { 44 classname = "way"; 45 } 26 46 Iterator<String> iterator = p.keys.keySet().iterator(); 27 47 while(iterator.hasNext()) 28 48 { 29 49 String key = iterator.next(); 30 String kv = key + "=" + p.keys.get(key) ;50 String kv = key + "=" + p.keys.get(key) + classname; 31 51 if(styles.containsKey(kv)) 32 52 { -
applications/editors/josm/plugins/mappaint/styles/standard/elemstyles.xml
r3583 r3590 9 9 4. area attributes 10 10 - colour 11 5. amenityattributes11 5. icon attributes 12 12 - icon path to icon , relative from where this file is 13 14 Using both area and line attributes for the same key/value pair doesn't work! 13 15 --> 14 16 … … 712 714 <condition k="amenity" v="parking" /> 713 715 <icon annotate="true" src="carpark.png" /> 714 <scale_min>1</scale_min>715 <scale_max>50000</scale_max>716 </rule>717 718 <!-- enabling parking areas will hide single parking nodes COMPLETELY.719 unless this is fixed in mappaint, disable the area for now!720 <rule>721 <condition k="amenity" v="parking" />722 <icon annotate="true" src="carpark.png" />723 716 <area colour="#f7efb7"/> 724 717 <scale_min>1</scale_min> 725 718 <scale_max>50000</scale_max> 726 719 </rule> 727 -->728 720 729 721 <rule>
Note:
See TracChangeset
for help on using the changeset viewer.