This is a sample map showing custom markers. This can be achieved by using the display mode “text markers”. This mode normally displays text instead of circles at the marker position. If you replace the default font of the text markers by an icon font, we will be able to use icons on our map. In this example, we used the icon font FontAwesome.
In the following, we will describe what has to be changed in the map template to get icon markers. This is what we have to do:
- This seems to be obvious, but we have to make sure that the display mode is set to “Text” (right column, third box from top). Otherwise, this technique won’t work.
- Then, we have to make sure that our icon font is available on the page where the map will be inserted. Therefore, we have to add the following line to the HTML of our map template:
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
- The next step is to change the default font of our text markers. We achieve this by adding the following lines to our CSS:
#{cssid} text { font-family: FontAwesome; fill: #534C92; }
This sets the new font. Thefill
property can be used to change the font color. We used a purple color (#534C92
) - We apply the changes on our map template by pressing the “Update template” button. The map preview should reload now.
Then we are all set and can start to add text markers. This is the easiest way to add new markers:
- FontAwesome has a cheatsheet for their icons. Pick one icon that you want to add to your map. Use your mouse to select one of the icons and copy it to the clipboard (right click -> copy). If you prefer, you can also copy this one:
- If you go back to your map, you can click on “Add Text” to add a new marker.
- Set a “Text Location”. For example, we could use “New York”.
- The “Text Label” contains the text that will be displayed on the map. We insert the icon from the clipboard (right click -> paste). Note that the displayed text will look broken, but this is normal.
- If we click on “Add”, we should see the marker on our map.
The map configuration can be seen here:
Comments
If you need help or have questions, please leave a comment.