Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

locateOptions (eg: keepCurrentZoomLevel) Not Working #331

Open
c0nsumer opened this issue Jan 15, 2023 · 0 comments
Open

locateOptions (eg: keepCurrentZoomLevel) Not Working #331

c0nsumer opened this issue Jan 15, 2023 · 0 comments

Comments

@c0nsumer
Copy link

I am using Leaflet v1.9.3 with the latest version of leaflet-locatecontrol as of 2023-Jan-15.

The issue I am running into is that setting locateOptions doesn't seem to work. For example, I am doing this:

// Add a geolocation control
        L.control.locate({
            strings: {
                title: "Show my location",
                outsideMapBoundsMsg: "Your location is outside the RAMBA area.",
            },
            locateOptions: {
                flyTo: true,
                enableHighAccuracy: true,
                keepCurrentZoomLevel: true,
                initialZoomLevel: false,
                showPopup: false,
                setView: false,
                metric: false,
            },
        }).addTo(trailmap);

However, things like showPopup and keepCurrentZoomLevel aren't being used.

If I use L.Control.Locate.js (not the minified version) and set them directly (lines 179 and 323) in here, then they work fine.

@c0nsumer c0nsumer changed the title keepCurrentZoomLevel Not Working locateOptions (eg: keepCurrentZoomLevel) Not Working Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant