mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Add new poi icons, make them work on point, vertex, area label
(closes #3856)
This commit is contained in:
+1
-1
@@ -62,7 +62,7 @@ g.vertex .stroke {
|
||||
}
|
||||
|
||||
g.vertex.shared .stroke {
|
||||
fill: #aaa;
|
||||
fill: #bbb;
|
||||
}
|
||||
|
||||
g.midpoint .fill {
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
"railway/level_crossing",
|
||||
"highway/traffic_signals",
|
||||
"highway/turning_circle",
|
||||
"highway/turning_loop",
|
||||
"traffic_calming",
|
||||
"highway/mini_roundabout",
|
||||
"highway/motorway_junction",
|
||||
|
||||
@@ -4624,7 +4624,7 @@
|
||||
"name": "Defibrillator"
|
||||
},
|
||||
"emergency/fire_hydrant": {
|
||||
"icon": "fire-station",
|
||||
"icon": "poi-fire-hydrant",
|
||||
"fields": [
|
||||
"fire_hydrant/type",
|
||||
"fire_hydrant/position"
|
||||
@@ -4964,6 +4964,7 @@
|
||||
"name": "Street Crossing"
|
||||
},
|
||||
"highway/crosswalk": {
|
||||
"icon": "poi-foot",
|
||||
"fields": [
|
||||
"crossing",
|
||||
"kerb",
|
||||
@@ -5028,6 +5029,7 @@
|
||||
"name": "Foot Path"
|
||||
},
|
||||
"highway/give_way": {
|
||||
"icon": "poi-yield",
|
||||
"fields": [
|
||||
"parallel_direction"
|
||||
],
|
||||
@@ -5511,6 +5513,7 @@
|
||||
"name": "Service Area"
|
||||
},
|
||||
"highway/steps": {
|
||||
"icon": "highway-steps",
|
||||
"fields": [
|
||||
"surface",
|
||||
"lit",
|
||||
@@ -5519,7 +5522,6 @@
|
||||
"handrail",
|
||||
"step_count"
|
||||
],
|
||||
"icon": "highway-steps",
|
||||
"geometry": [
|
||||
"line"
|
||||
],
|
||||
@@ -5533,6 +5535,7 @@
|
||||
"name": "Steps"
|
||||
},
|
||||
"highway/stop": {
|
||||
"icon": "poi-stop",
|
||||
"fields": [
|
||||
"stop",
|
||||
"parallel_direction"
|
||||
@@ -5684,6 +5687,7 @@
|
||||
"name": "Traffic Mirror"
|
||||
},
|
||||
"highway/traffic_signals": {
|
||||
"icon": "poi-traffic-signals",
|
||||
"geometry": [
|
||||
"vertex"
|
||||
],
|
||||
@@ -12054,6 +12058,7 @@
|
||||
"name": "Zoo"
|
||||
},
|
||||
"traffic_calming": {
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"traffic_calming",
|
||||
"parallel_direction"
|
||||
@@ -12074,6 +12079,7 @@
|
||||
"name": "Traffic Calming"
|
||||
},
|
||||
"traffic_calming/bump": {
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"surface",
|
||||
"parallel_direction"
|
||||
@@ -12093,6 +12099,7 @@
|
||||
"name": "Speed Bump"
|
||||
},
|
||||
"traffic_calming/chicane": {
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"parallel_direction"
|
||||
],
|
||||
@@ -12111,6 +12118,7 @@
|
||||
"name": "Traffic Chicane"
|
||||
},
|
||||
"traffic_calming/choker": {
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"parallel_direction"
|
||||
],
|
||||
@@ -12128,6 +12136,7 @@
|
||||
"name": "Traffic Choker"
|
||||
},
|
||||
"traffic_calming/cushion": {
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"surface",
|
||||
"parallel_direction"
|
||||
@@ -12148,6 +12157,7 @@
|
||||
"name": "Speed Cushion"
|
||||
},
|
||||
"traffic_calming/dip": {
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"surface",
|
||||
"parallel_direction"
|
||||
@@ -12166,6 +12176,7 @@
|
||||
"name": "Dip"
|
||||
},
|
||||
"traffic_calming/hump": {
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"surface",
|
||||
"parallel_direction"
|
||||
@@ -12185,7 +12196,7 @@
|
||||
"name": "Speed Hump"
|
||||
},
|
||||
"traffic_calming/island": {
|
||||
"icon": "circle",
|
||||
"icon": "poi-warning",
|
||||
"geometry": [
|
||||
"vertex"
|
||||
],
|
||||
@@ -12200,6 +12211,7 @@
|
||||
"name": "Traffic Island"
|
||||
},
|
||||
"traffic_calming/rumble_strip": {
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"parallel_direction"
|
||||
],
|
||||
@@ -12218,6 +12230,7 @@
|
||||
"name": "Rumble Strip"
|
||||
},
|
||||
"traffic_calming/table": {
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"surface"
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"icon": "fire-station",
|
||||
"icon": "poi-fire-hydrant",
|
||||
"fields": [
|
||||
"fire_hydrant/type",
|
||||
"fire_hydrant/position"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"icon": "poi-foot",
|
||||
"fields": [
|
||||
"crossing",
|
||||
"kerb",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"icon": "poi-yield",
|
||||
"fields": [
|
||||
"parallel_direction"
|
||||
],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"icon": "highway-steps",
|
||||
"fields": [
|
||||
"surface",
|
||||
"lit",
|
||||
@@ -7,7 +8,6 @@
|
||||
"handrail",
|
||||
"step_count"
|
||||
],
|
||||
"icon": "highway-steps",
|
||||
"geometry": [
|
||||
"line"
|
||||
],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"icon": "poi-stop",
|
||||
"fields": [
|
||||
"stop",
|
||||
"parallel_direction"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"icon": "poi-traffic-signals",
|
||||
"geometry": [
|
||||
"vertex"
|
||||
],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"traffic_calming",
|
||||
"parallel_direction"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"surface",
|
||||
"parallel_direction"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"parallel_direction"
|
||||
],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"parallel_direction"
|
||||
],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"surface",
|
||||
"parallel_direction"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"surface",
|
||||
"parallel_direction"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"surface",
|
||||
"parallel_direction"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"icon": "circle",
|
||||
"icon": "poi-warning",
|
||||
"geometry": [
|
||||
"vertex"
|
||||
],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"parallel_direction"
|
||||
],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"icon": "poi-warning",
|
||||
"fields": [
|
||||
"surface"
|
||||
],
|
||||
|
||||
+10
-2
@@ -1,6 +1,7 @@
|
||||
import * as d3 from 'd3';
|
||||
import _ from 'lodash';
|
||||
import rbush from 'rbush';
|
||||
import { dataFeatureIcons } from '../../data/index';
|
||||
import { textDirection } from '../util/locale';
|
||||
|
||||
import {
|
||||
@@ -201,8 +202,15 @@ export function svgLabels(projection, context) {
|
||||
icons
|
||||
.attr('transform', get(labels, 'transform'))
|
||||
.attr('xlink:href', function(d) {
|
||||
var icon = context.presets().match(d, context.graph()).icon;
|
||||
return '#' + icon + '-15';
|
||||
var preset = context.presets().match(d, context.graph()),
|
||||
picon = preset && preset.icon;
|
||||
|
||||
if (!picon)
|
||||
return '';
|
||||
else {
|
||||
var isMaki = dataFeatureIcons.indexOf(picon) !== -1;
|
||||
return '#' + picon + (isMaki ? '-15' : '');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+10
-2
@@ -1,4 +1,5 @@
|
||||
import _ from 'lodash';
|
||||
import { dataFeatureIcons } from '../../data/index';
|
||||
import { osmEntity } from '../osm/index';
|
||||
import { svgPointTransform, svgTagClasses } from './index';
|
||||
|
||||
@@ -62,8 +63,15 @@ export function svgPoints(projection, context) {
|
||||
groups.select('.stroke');
|
||||
groups.select('.icon')
|
||||
.attr('xlink:href', function(entity) {
|
||||
var preset = context.presets().match(entity, graph);
|
||||
return (preset && preset.icon) ? '#' + preset.icon + '-11' : '';
|
||||
var preset = context.presets().match(entity, graph),
|
||||
picon = preset && preset.icon;
|
||||
|
||||
if (!picon)
|
||||
return '';
|
||||
else {
|
||||
var isMaki = dataFeatureIcons.indexOf(picon) !== -1;
|
||||
return '#' + picon + (isMaki ? '-11' : '');
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import * as d3 from 'd3';
|
||||
import { dataFeatureIcons } from '../../data/index';
|
||||
import { osmEntity } from '../osm/index';
|
||||
import { svgPointTransform } from './index';
|
||||
|
||||
@@ -130,7 +131,12 @@ export function svgVertices(projection, context) {
|
||||
enter.filter(function(d) { return icon(d); })
|
||||
.append('use')
|
||||
.attr('transform', 'translate(-5, -6)')
|
||||
.attr('xlink:href', function(d) { return '#' + icon(d) + '-11'; })
|
||||
.attr('xlink:href', function(d) {
|
||||
var picon = icon(d),
|
||||
isPoi = picon.match(/^poi-/) !== null,
|
||||
isMaki = dataFeatureIcons.indexOf(picon) !== -1;
|
||||
return '#' + picon + (isMaki ? '-11' : '');
|
||||
})
|
||||
.attr('width', '11px')
|
||||
.attr('height', '11px')
|
||||
.each(setClass('icon'));
|
||||
|
||||
@@ -18,6 +18,7 @@ export function uiPresetIcon() {
|
||||
p = preset.apply(this, arguments),
|
||||
geom = geometry.apply(this, arguments),
|
||||
picon = p.icon || (geom === 'line' ? 'other-line' : 'marker-stroked'),
|
||||
isPoi = picon.match(/^poi-/) !== null,
|
||||
isMaki = dataFeatureIcons.indexOf(picon) !== -1;
|
||||
|
||||
function tag_classes(p) {
|
||||
@@ -68,7 +69,7 @@ export function uiPresetIcon() {
|
||||
|
||||
icon
|
||||
.attr('class', 'preset-icon preset-icon-' +
|
||||
(isMaki ? (geom === 'area' ? '24' : '28') : (geom === 'area' ? '44' : '60'))
|
||||
((isMaki || isPoi) ? (geom === 'area' ? '24' : '28') : (geom === 'area' ? '44' : '60'))
|
||||
);
|
||||
|
||||
icon.selectAll('svg')
|
||||
|
||||
@@ -261,12 +261,14 @@
|
||||
"poi-yield": { "viewBox": "430 320 15 15" },
|
||||
"poi-stop": { "viewBox": "445 320 15 15" },
|
||||
"poi-warning": { "viewBox": "460 320 15 15" },
|
||||
"poi-fire-hydrant": { "viewBox": "475 320 15 15" },
|
||||
|
||||
"poi-foot-shape": { "fill": "currentColor" },
|
||||
"poi-traffic-signals-shape": { "fill": "currentColor" },
|
||||
"poi-yield-shape": { "fill": "currentColor" },
|
||||
"poi-stop-shape": { "fill": "currentColor" },
|
||||
"poi-warning-shape": { "fill": "currentColor" },
|
||||
"poi-fire-hydrant-shape": { "fill": "currentColor" },
|
||||
|
||||
"turn-yes": { "viewBox": "200 320 44 24" },
|
||||
"turn-no": { "viewBox": "244 320 44 24" },
|
||||
|
||||
Binary file not shown.
@@ -232,20 +232,24 @@
|
||||
</g>
|
||||
</g>
|
||||
<g id="poi">
|
||||
<g id="poi-fire-hydrant">
|
||||
<path d="M482.5,320.5 C482.888,320.5 483.203,320.82 483.203,321.214 L483.203,321.178 C484.382,321.407 484.872,322.149 485.265,323.214 L485.453,323.214 C485.686,323.214 485.875,323.47 485.875,323.786 C485.875,324.101 485.686,324.357 485.453,324.357 L484.75,324.357 L484.75,326.357 L486.438,326.357 C486.748,326.357 487,326.613 487,326.929 L487,328.643 C487,328.958 486.748,329.214 486.438,329.214 L484.75,329.214 L484.75,333.071 L485.312,333.071 C485.701,333.071 486.016,333.391 486.016,333.786 C486.016,334.18 485.701,334.5 485.312,334.5 L479.687,334.5 C479.299,334.5 478.984,334.18 478.984,333.786 C478.984,333.391 479.299,333.071 479.688,333.071 L480.25,333.071 L480.25,329.214 L478.562,329.214 C478.252,329.214 478,328.958 478,328.643 L478,326.928 C478,326.613 478.252,326.357 478.562,326.357 L480.25,326.357 L480.25,324.357 L479.547,324.357 C479.314,324.357 479.125,324.101 479.125,323.786 C479.125,323.47 479.314,323.214 479.547,323.214 L479.698,323.214 C480.08,321.92 480.63,321.613 481.797,321.178 L481.797,321.214 C481.797,320.82 482.112,320.5 482.5,320.5 z" fill="#000000" id="poi-fire-hydrant-shape"/>
|
||||
</g>
|
||||
<g id="poi-warning">
|
||||
<path d="M467.5,321 L474,327.5 L467.5,334 L461,327.5 L467.5,321 z M467.5,323.828 L463.829,327.5 L467.5,331.172 L471.172,327.5 L467.5,323.828 z" fill="#000000" id="poi-warning-shape"/>
|
||||
<path d="M467.5,320.5 L474.5,327.5 L467.5,334.5 L460.5,327.5 L467.5,320.5 z M467.5,322.784 L462.784,327.5 L467.5,332.216 L472.216,327.5 L467.5,322.784 z" fill="#000000" id="poi-warning-shape"/>
|
||||
</g>
|
||||
<g id="poi-stop">
|
||||
<path d="M455.192,321 L459,324.808 L459,330.192 L455.192,334 L449.808,334 L446,330.192 L446,324.808 L449.808,321 L455.192,321 z M454.364,323 L450.636,323 L448,325.636 L448,329.364 L450.636,332 L454.364,332 L457,329.364 L457,325.636 L454.364,323 z" fill="#000000" id="poi-stop-shape"/>
|
||||
<path d="M455.192,321 L459,324.808 L459,330.192 L455.192,334 L449.808,334 L446,330.192 L446,324.808 L449.808,321 L455.192,321 z" fill="#000000" id="poi-stop-shape"/>
|
||||
<path d="M454.538,322.58 L457.42,325.462 L457.42,329.538 L454.538,332.42 L450.462,332.42 L447.58,329.538 L447.58,325.462 L450.462,322.58 L454.538,322.58 z" fill="#000000"/>
|
||||
</g>
|
||||
<g id="poi-yield">
|
||||
<path d="M445,321.5 L437.5,334 L430,321.5 L445,321.5 z M441.468,323.5 L433.532,323.5 L437.5,330.113 L441.468,323.5 z" fill="#000000" id="poi-yield-shape"/>
|
||||
<path d="M444.5,321.5 L437.5,334 L430.5,321.5 L444.5,321.5 z M442.027,323 L432.973,323 L437.5,331.085 L442.027,323 z" fill="#000000" id="poi-yield-shape"/>
|
||||
</g>
|
||||
<g id="poi-traffic-signals">
|
||||
<path d="M422.5,334.5 C421.395,334.5 420.5,333.605 420.5,332.5 C420.5,331.395 421.395,330.5 422.5,330.5 C423.605,330.5 424.5,331.395 424.5,332.5 C424.5,333.605 423.605,334.5 422.5,334.5 z M422.5,329.5 C423.605,329.5 424.5,328.605 424.5,327.5 C424.5,326.395 423.605,325.5 422.5,325.5 C421.395,325.5 420.5,326.395 420.5,327.5 C420.5,328.605 421.395,329.5 422.5,329.5 z M422.5,324.5 C423.605,324.5 424.5,323.605 424.5,322.5 C424.5,321.395 423.605,320.5 422.5,320.5 C421.395,320.5 420.5,321.395 420.5,322.5 C420.5,323.605 421.395,324.5 422.5,324.5 z" fill="#000000" id="poi-traffic-signals-shape"/>
|
||||
<path d="M424.214,320 C425.477,320 426.5,321.033 426.5,322.308 L426.5,332.692 C426.5,333.967 425.477,335 424.214,335 L420.786,335 C419.523,335 418.5,333.967 418.5,332.692 L418.5,322.308 C418.5,321.033 419.523,320 420.786,320 L424.214,320 z M422.5,330.5 C421.672,330.5 421,331.172 421,332 C421,332.828 421.672,333.5 422.5,333.5 C423.329,333.5 424,332.828 424,332 C424,331.172 423.329,330.5 422.5,330.5 z M422.5,326 C421.672,326 421,326.672 421,327.5 C421,328.328 421.672,329 422.5,329 C423.329,329 424,328.328 424,327.5 C424,326.672 423.329,326 422.5,326 z M422.5,321.5 C421.672,321.5 421,322.172 421,323 C421,323.828 421.672,324.5 422.5,324.5 C423.329,324.5 424,323.828 424,323 C424,322.172 423.329,321.5 422.5,321.5 z" fill="#000000"/>
|
||||
</g>
|
||||
<g id="poi-foot">
|
||||
<path d="M408.875,321.562 C408.875,322.425 408.175,323.125 407.312,323.125 C406.45,323.125 405.75,322.425 405.75,321.562 C405.75,320.7 406.45,320 407.312,320 C408.175,320 408.875,320.7 408.875,321.562 z M405.75,323.75 L406.375,323.75 L406.688,323.75 L412,327.812 L412,328.75 L411.375,328.75 L408.25,326.328 L408.25,328.75 L409.5,331.25 L410.75,334.375 L410.125,335 L409.5,335 L408.25,331.875 L405.75,328.125 L405.75,325.215 L404.188,326.562 L402.938,328.75 L402,328.75 L402,328.125 L402.938,326.25 L405.75,323.75 z M406.277,330.254 L404.832,335 L404.188,335 L403.562,334.375 L405.32,329.102 z" fill="#000000" id="poi-foot-shape"/>
|
||||
<path d="M409.375,321.958 C409.375,322.764 408.675,323.417 407.812,323.417 C406.95,323.417 406.25,322.764 406.25,321.958 C406.25,321.153 406.95,320.5 407.812,320.5 C408.675,320.5 409.375,321.153 409.375,321.958 z M406.25,324 L406.875,324 L407.188,324 L412.5,327.792 L412.5,328.667 L411.875,328.667 L408.75,326.406 L408.75,328.667 L410,331 L411.25,333.917 L410.625,334.5 L410,334.5 L408.75,331.583 L406.25,328.083 L406.25,325.367 L404.688,326.625 L403.438,328.667 L402.5,328.667 L402.5,328.083 L403.438,326.333 L406.25,324 z M406.777,330.07 L405.332,334.5 L404.688,334.5 L404.062,333.917 L405.82,328.995 z" fill="#000000" id="poi-foot-shape"/>
|
||||
</g>
|
||||
</g>
|
||||
<g id="relations">
|
||||
|
||||
|
Before Width: | Height: | Size: 230 KiB After Width: | Height: | Size: 231 KiB |
Reference in New Issue
Block a user