• Resolved ginot

    (@ginot)


    Hi!
    Really nice and versatile plugin you made, kudos. But the one thing I can’t figure out is how to use .svg as markers.
    I thought that by just giving the url of the .svg, the plugin would do the same as a raster image (img src=””). But it doesn’t, it changes the link to the default one. Why?

    Thanks for your help

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ginot

    (@ginot)

    I solved it.. if anyone else finds it useful, you also need to set the iconSize=”” parametre. And that’s it.

    Plugin Author bozdoz

    (@bozdoz)

    Perfect. Thanks. You should be able to see an example on the Shortcode Helper page in the admin too. It’s important to give an iconAnchor too, so that the image is properly positioned just above the point:

    [leaflet-marker iconUrl=”https://i.imgur.com/Q54ueuO.png” iconSize=”80,50″ iconAnchor=”40,60″]

    I believe that’s just roughly put together: if the icon is 80 wide, the anchor is at the middle (40), and if the icon is 50 tall, then position it 10 pixels above the point (which obviously isn’t always what you’d want).

    Here’s the path to the shortcode helper if that helps:

    your-site.com/wp-admin/admin.php?page=leaflet-get-shortcode

    Thanks again for following up.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Svg Markers’ is closed to new replies.