• Plugin Contributor hupe13

    (@hupe13)


    Hi Bozdoz,

    there is a fitbound parameter for leaflet-map and for leaflet-elements.
    [leaflet-map fitbounds] zooms to all elements.

    [leaflet-map !fitbounds]
    [leaflet-element fitbounds]

    zooms to the leaflet-element.
    If you have two [fitbounds] it is undefined to which the map zooms.
    So fitbounds should only be used once per map. Is that correct?

    Thank you.

    • This topic was modified 4 years, 3 months ago by hupe13.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor hupe13

    (@hupe13)

    Setting the marker to latitude 0 and longitude 0 does not work:

    [leaflet-map fitbounds]
    [leaflet-marker lat=0 lng=0]Null[/leaflet-marker]
    Plugin Author bozdoz

    (@bozdoz)

    Yeah fitbounds ought to only be on the leaflet-map shortcode; the other ones came first, but I think are deprecated. You either fitbounds to all layers, or you don’t. Also, yes, you can’t fitbounds to a marker because it doesn’t take up any area. The solution is just to set the map to the location of the marker:

    [leaflet-map lat=0 lng=0]
    [leaflet-marker]Null[/leaflet-marker]

    Plugin Contributor hupe13

    (@hupe13)

    I read your documentation on Github again. It isn’t easy to program this with zoomhome in my plugin.
    But setting a marker to 0,0 doesn’t work at all, this seems to be a bug.

    but I think are deprecated.

    I’m zooming to one element in a map on my website to show a detail. It would be a pity if this no longer exist.

    • This reply was modified 4 years, 3 months ago by hupe13.
    Plugin Author bozdoz

    (@bozdoz)

    Could you give me an example of what’s not working?

    just this?

    [leaflet-map fitbounds]
    [leaflet-marker lat=0 lng=0]Null[/leaflet-marker]

    Plugin Author bozdoz

    (@bozdoz)

    Might have fixed this in 3.0.4

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

The topic ‘fitbounds’ is closed to new replies.