#10176 closed enhancement (fixed)
icon-image is not working for area
Reported by: | mkoniecz | Owned by: | team |
---|---|---|---|
Priority: | major | Milestone: | 17.03 |
Component: | Core mappaint | Version: | |
Keywords: | area icon | Cc: | skyper, lists@…, Chenshi, Klumbumbus |
Description (last modified by )
note: #9270 should be reopened once this feature is included
With style
area[amenity=parking]{ icon-image: vehicle/parking.png; fill-color: amenity_traffic#f7efb7; }
File exists, as reverting it to standard style causes this icon to be displayed on parking nodes.
What happens: causes amenity=parking areas to be coloured but no icon appears anywhere
Expected: in center of area parking icon appears
According to http://wiki.openstreetmap.org/wiki/MapCSS/0.2#Point.2Ficon_properties it is expected not only by me.
I hope that this time Core mappaint is correct category
Repository Root: http://josm.openstreetmap.de/svn Build-Date: 2014-06-20 01:36:37 Last Changed Author: simon04 Revision: 7254 Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b URL: http://josm.openstreetmap.de/svn/trunk Last Changed Date: 2014-06-19 11:09:04 +0200 (Thu, 19 Jun 2014) Last Changed Rev: 7254 Identification: JOSM/1.5 (7254 en) Windows 7 32-Bit Memory Usage: 80 MB / 247 MB (36 MB allocated, but free) Java version: 1.7.0_55, Oracle Corporation, Java HotSpot(TM) Client VM Dataset consistency test: No problems found Plugin: OpeningHoursEditor (30416) Plugin: RoadSigns (30495) Plugin: buildings_tools (30485) Plugin: continuosDownload (28565) Plugin: lakewalker (30416) Plugin: measurement (30416) Plugin: notes (v0.9.2) Plugin: wikipedia (30449)
Attachments (0)
Change History (35)
comment:1 by , 11 years ago
Description: | modified (diff) |
---|
comment:2 by , 11 years ago
Description: | modified (diff) |
---|
comment:3 by , 11 years ago
Cc: | added |
---|
comment:4 by , 11 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
comment:5 by , 11 years ago
comment:6 by , 11 years ago
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
comment:9 by , 11 years ago
Description: | modified (diff) |
---|
comment:11 by , 11 years ago
Cc: | added |
---|
comment:12 by , 11 years ago
When this is supported, mapcss implementation should accept image-icon to area and render a single icon at the center of gravity of an area.
comment:14 by , 11 years ago
Cc: | added |
---|
comment:15 by , 11 years ago
Cc: | added |
---|
comment:16 by , 11 years ago
Description: | modified (diff) |
---|---|
Keywords: | area icon added |
comment:17 by , 10 years ago
My proposal from ticket #10187 is to show the icon a bit larger (scaled up) than if it was on a node to make it clear it is from the area. It would then be easy to see if there is duplication of the same tags on area and a node inside the area.
comment:18 by , 9 years ago
Hello,
There is another need for this feature (for which I see that there have been several requests, and since a long time ago: http://wiki.openstreetmap.org/wiki/Talk:MapCSS/0.2#icon-image_on_areas ;-) ), to support a building damage assessment methodology - in particular for Fiji for now (http://hhi.harvard.edu/publications/satellite-imagery-interpretation-guide-assessing-wind-disaster-damage-structures), for which it would be useful to display an icon over each building having the appropriate tags.
I have prepared a preset and a mapcss style to support this methodology in JOSM, and this missing feature is the main remaining issue. (fill-image can be a temporary work-around, but it is not really satisfactory).
Thank you very much in advance if you can do anything about it.
Jean-Guilhem
follow-up: 20 comment:19 by , 8 years ago
The lack of this feature is the main reason that many POI get two tags, one on the building and one on a node inside the building. This has been requested a long time ago, and there are also questions on the wiki relating to that: https://help.openstreetmap.org/questions/3824/should-amenities-eg-supermarkets-be-ways-or-nodes
Can this be included into MapCSS or at least can someone provide a Map point style that has this feature, or is there a way to create one?
Check "FINCA" on this map: https://www.openstreetmap.org/edit?editor=id#map=19/38.10865/70.02980
comment:20 by , 8 years ago
Actually, this is encouraging people to add a single feature twice, which should not be done (https://wiki.openstreetmap.org/wiki/One_feature,_one_OSM_element). So this is VERY URGENT!
follow-up: 25 comment:22 by , 8 years ago
Milestone: | → 17.03 |
---|
I added basic support for this. The icon is parsed the same way as it is for nodes (supporting offset/rotation).
I currently only put the icon at the center of the bbox. Center of weight computation should be somewhere in our codebase, I'll have to find it first and see if the performance is good enough. Since way bboxes are cached, they should be pretty fast. Multipolygons walk every outer node for now.
comment:23 by , 8 years ago
Please don't forget that all functions should have Javadoc and new functions should have "@since revsion" text.
Center at lat/lon is a bit dangerous, as it may be outside the area often for very common objects like U-shaped houses.
follow-up: 27 comment:25 by , 8 years ago
Replying to michael2402:
Center of weight computation should be somewhere in our codebase, I'll have to find it first
I don't know if this helps: r7459
comment:26 by , 8 years ago
Priority: | normal → major |
---|
follow-up: 28 comment:27 by , 8 years ago
Great, this was one of the larger missing features in all of JOSM!
Replying to Klumbumbus:
Replying to michael2402:
Center of weight computation should be somewhere in our codebase, I'll have to find it first
I don't know if this helps: r7459
Yes, there is fairly complex code to find the label placement inside an area. It would make sense to have the label and the icon in some relation to each other, e.g. text centered below the image.
Currently, the label is not displayed when it doesn't fit completely inside the area. Maybe this can be relaxed, to print the text regardless of the area shape (and only take the total area size as threshold if needed). I find it annoying that the (long) name of a small building is not displayed as you can't tell if the name is already tagged or not.
(Please don't forget to update equals
and hashCode
, weird things will happen otherwise.)
comment:28 by , 8 years ago
Replying to bastiK:
Yes, there is fairly complex code to find the label placement inside an area.
I didn't find a way to make it nicer at the time. If someone sees how to improve this code, feel free to do so :) I'm pretty sure it can be optimized.
comment:30 by , 8 years ago
StyledMapRenderer
has grown to be pretty complex right now.
I would like to split the class in two parts: The renderer (doing style computations) and the draw...-methods. For now, we could use inheritance for this. In the long run, separating them completely would be the nicer way.
And I'd suggest moving the OffsettIterator
to a separate class.
follow-up: 36 comment:34 by , 8 years ago
The multipolygon fill color broke somewhere between 11747 and 11757
comment:35 by , 8 years ago
Please also add end user documentation for your fancy new features at wiki:Help/Styles/MapCSSImplementation, else nobody will use it.
comment:36 by , 8 years ago
Replying to Klumbumbus:
The multipolygon fill color broke somewhere between 11747 and 11757
Should be fixed in [11759].
I am already on the docs. I added the opacity changes there. And I added a note to the MapCSS talk page to see if there are any objections Link. The mailing list looks abandoned. I'm currently searching through the mapcss docs of other software to see if they have anything like an icon placement on the line - but it does not look that way. This is sort of a bonus when allowing the user to chose between placing the icon inside the area or just so that a part of it is inside the area.
I don't want to put it in the docs until the naming is more stable...
Closed as duplicate of #9270.