Browse Source

marker-icons: no need to use the raw filter

master
parent
commit
6d94ec2d76
  1. 6
      doc/Icons.md
  2. 8
      src/markers.js

6
doc/Icons.md

@ -53,7 +53,7 @@ You can pass URL options to the icon to modify its look. Note that every icon is
Simple syntax (example: a black line):
```html
<img data-src="marker:line?width=3&amp;color=black">
{{ markerLine({ width: 3, color: 'black' })|raw }}
{{ markerLine({ width: 3, color: 'black' }) }}
```
The following marker types are available: line, polygon (a rectangle), circle, pointer
@ -70,10 +70,10 @@ The following style parameters are possible:
Syntax with multiple symbols (example: a white line with a black casing). Only styles which are listed in the `styles` parameter will be used. Instead of `style:default:width` use `style:width`:
```html
<img data-src="marker:line?styles=casing,default&amp;style:width=2&amp;style:color=white&amp;style:casing:width=4&amp;style:casing:color=black">
{{ markerLine({ styles: 'casing,default', 'style:casing': { color: 'black', width: 4 }, default: { color: 'black', width: 2 }})|raw }}
{{ markerLine({ styles: 'casing,default', 'style:casing': { color: 'black', width: 4 }, default: { color: 'black', width: 2 }}) }}
```
You can use the `evaluate` function, to emulate a fake object (e.g. for map keys). The following example would draw a line, which looks like the symbol which is generated by this category for an OSM object with the tags highway=primary and maxspeed=80:
```html
{{ markerLine(evaluate({ "highway": "primary", "maxspeed": "80" }))|raw }}
{{ markerLine(evaluate({ "highway": "primary", "maxspeed": "80" })) }}
```

8
src/markers.js

@ -45,7 +45,7 @@ function markerLine (data) {
ret += '</svg>'
return ret
return OverpassLayer.twig.filters.raw(ret)
}
function markerPolygon (data) {
@ -59,7 +59,7 @@ function markerPolygon (data) {
ret += '</svg>'
return ret
return OverpassLayer.twig.filters.raw(ret)
}
function markerCircle (data) {
@ -77,7 +77,7 @@ function markerCircle (data) {
ret += '</svg>'
return ret
return OverpassLayer.twig.filters.raw(ret)
}
function markerPointer (data) {
@ -91,7 +91,7 @@ function markerPointer (data) {
ret += '</svg>'
return ret
return OverpassLayer.twig.filters.raw(ret)
}
function parseOptions (data) {

Loading…
Cancel
Save