• ResolvedPlugin Contributor hupe13

    (@hupe13)


    Hello Bozdoz,

    I’m using the following code:
    [leaflet-marker iconUrl="/path/img/myimage.png" iconSize="32,32" iconAnchor="16,16" popupAnchor="16,16" lat=52.16 lng=12.85]Popup Text[/leaflet-marker]

    It works without the popupAnchor parameter, but with it doesn’t. When I click the icon, the popup doesn’t open, the map jumps to lat/lng 16,16.

    Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor hupe13

    (@hupe13)

    Correction: It jumps to lat/lng approximately 0,90. This is the North Pole.

    Plugin Author bozdoz

    (@bozdoz)

    Yeah, that seems very weird. Try setting it to negative numbers, like this example:

    https://leafletjs.com/reference-1.4.0.html#icon

    Maybe -1,-1 even, just to see what it does. In my test, it still puts the popup quite far away from the marker.

    Plugin Contributor hupe13

    (@hupe13)

    _options.popupAnchor must be an array of integers, it is an array of strings. This works for me:

    diff shortcodes/class.marker-shortcode.php shortcodes/class.marker-shortcode.php.orig
    160,162c160,161
    <  } else {
    < _options.popupAnchor=_options.popupAnchor.map(Number);
    <  }
    ---
    >  }
    >

    The value for popupAnchor is “0,-16”.

    Plugin Author bozdoz

    (@bozdoz)

    You are completely correct. Thanks! I’ll push a fix for this.

    Plugin Author bozdoz

    (@bozdoz)

    Fixed in 2.14.0!

    Plugin Contributor hupe13

    (@hupe13)

    Thank you.

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

The topic ‘popupAnchor’ is closed to new replies.