添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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.

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]

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.