You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
3.4 KiB

5 years ago
  1. #### Unicode Icons
  2. Unicode defines many icons which can be used either directly or via their HTML codes, e.g.:
  3. ```html
  4. 🎂 🎂 🎂
  5. ```
  6. A drawback of Unicode icons is, that the display will differ from system to system as they depend on the available Fonts.
  7. #### Self defined icons
  8. You may upload images to your repository and use them via a relative image link:
  9. ```html
  10. <img data-src='img/foobar.svg'>
  11. ```
  12. This will include the image from your repository (when uploaded to your 'img' directory).
  13. #### Font Awesome Icons
  14. [Font Awesome 5 Free](https://fontawesome.com/) is included in OpenStreetBrowser, therefore you can use, e.g.:
  15. ```html
  16. <i class="fas fa-compass"></i> <!-- solid -->
  17. <i class="far fa-compass"></i> <!-- regular -->
  18. ```
  19. You can use normal CSS to modify its look, e.g.
  20. ```html
  21. <i style="color: red;" class="fas fa-compass" aria-hidden="true"></i>
  22. ```
  23. #### Mapbox Maki Icons
  24. [Mapbox Maki Icons 5](https://www.mapbox.com/maki-icons/) are also included in OpenStreetBrowser. They can be accessed as images with protocol 'maki', e.g.:
  25. ```html
  26. <img data-src="maki:park">
  27. ```
  28. This will include the park-15.svg icon. Mapbox Maki icons come in two sizes: 11 and 15. Default is 15, if you want to use 11 pass the size parameter with value 11:
  29. ```html
  30. <img data-src="maki:park?size=11">
  31. ```
  32. You can pass URL options to the icon to modify its look. Note that every icon is a [SVG path](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) and all [style options](https://developer.mozilla.org/de/docs/Web/SVG/Tutorial/Fills_and_Strokes) are available:
  33. ```html
  34. <img data-src="maki:park?size=11&amp;fill=red&amp;stroke=black&amp;stroke-width=0.5">
  35. ```
  36. #### Temaki Icons
  37. [Temaki icons](https://ideditor.github.io/temaki/docs/) are additions to the Mapbox Maki Icons with the difference that they only exist in to size of 15px.
  38. ```html
  39. <img data-src="temaki:shinto">
  40. <img data-src="temaki:shinto?fill=red">
  41. ```
  42. #### Markers
  43. Simple syntax (example: a black line):
  44. ```html
  45. <img data-src="marker:line?width=3&amp;color=black">
  46. {{ markerLine({ width: 3, color: 'black' }) }}
  47. ```
  48. The following marker types are available: line, polygon (a rectangle), circle, pointer
  49. The following style parameters are possible:
  50. * `color`: outline color, default `#000000`.
  51. * `width`: outline width, default `3`.
  52. * `offset`: outline offset, default `0`.
  53. * `fillColor`: color of the fill, default value of `color`. If no `color` is set, use `#f2756a`.
  54. * `fillOpacity`: opacity of the fill, default `0.2`.
  55. * `dashArray`: outline dashes, e.g. `5,5'. Default: `none`.
  56. * `dashOffset`: offset of outline dashes. Default: `0`.
  57. 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`:
  58. ```html
  59. <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">
  60. {{ markerLine({ styles: 'casing,default', 'style:casing': { color: 'black', width: 4 }, default: { color: 'black', width: 2 }}) }}
  61. ```
  62. 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:
  63. ```html
  64. {{ markerLine(evaluate({ "highway": "primary", "maxspeed": "80" })) }}
  65. ```