You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MapOptions should respect initialCenter option to init the user's camera when it does inside the initialCameraFit's bounds. If it is not, it's safe and should init the camera with the bounds' center.
What other alternatives are available?
Currently, we are planning to move the initialCameraFit to TileLayer.tileBounds. This should fix the issue but we may have to repeat it when we have more layers, which sounds like a bad smell. So we are looking for a solution in upstream.
Also, we noticed that there's bounds option may solve it too, but it is a deprecated option.
Can you provide any other information?
Before v6 (#1551), we used center to init the user's camera position, as well as nePanBoundary and swPanBoundary to constrain the user's camera to avoid invalid position selection.
@JaffaKetchup, it looks like what I'm looking for. I may be mislead by the bounds's deprecated info:
'bounds' is deprecated and shouldn't be used. Prefer initialCameraFit instead. This option is now part of initalCameraFit. This option is deprecated since v6.
It's a bit confusing. Shall we update the document? With cameraConstraint, why we still need the initialCameraFit to configure the initial fence?
cameraConstraint is permanent and prevents the camera from going outside the appropriate area, whereas initialCameraFit just positions the camera when the map is first built, instead of using initialCenter and initialZoom. They are two very different things. cameraConstraint used to be maxBounds, and initialCameraFit was previously bounds.
JaffaKetchup
added
invalid
This bug could not be reproduced or does not exist, or is very low quality
and removed
P: 3 (low)
(Default priority for feature requests)
labels
Nov 7, 2023
What do you want implemented?
The
MapOptions
should respectinitialCenter
option to init the user's camera when it does inside theinitialCameraFit
's bounds. If it is not, it's safe and should init the camera with the bounds' center.What other alternatives are available?
Currently, we are planning to move the
initialCameraFit
toTileLayer.tileBounds
. This should fix the issue but we may have to repeat it when we have more layers, which sounds like a bad smell. So we are looking for a solution in upstream.Also, we noticed that there'sbounds
option may solve it too, but it is a deprecated option.Can you provide any other information?
Before v6 (#1551), we used
center
to init the user's camera position, as well asnePanBoundary
andswPanBoundary
to constrain the user's camera to avoid invalid position selection.Now, it uses
initialCameraFit
to constrain the camera, but theinitialCenter
would be invalid as document mentioned.Severity
Annoying: Currently have to use workarounds
The text was updated successfully, but these errors were encountered: