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

moveToLocation not Refreshing Labels #127

Closed
TranquilAbyss opened this issue Aug 22, 2016 · 3 comments
Closed

moveToLocation not Refreshing Labels #127

TranquilAbyss opened this issue Aug 22, 2016 · 3 comments

Comments

@TranquilAbyss
Copy link

TranquilAbyss commented Aug 22, 2016

I have found an issue with the moveToLocation where the Leaflet Labels layers will not redraw, instead they stay in the same place on the screen from before the move.

Here is the code.

searchControl = L.control.search({
    layer: poiLayers,
    propertyName: 'name',
    moveToLocation: function(latlng, title, map) {
        var zoom = 2;
        map.setView(latlng, zoom); // access the zoom               
    }
}).addTo(map);

Leaflet Labels are part of the Overlay container. The map is also part of the overlay container and it appear to stay stationary.

The labels should be under the markers but those markers are from other places on the map.

@TranquilAbyss
Copy link
Author

I should add that I tried using map._onResize(); but it did not change anything.

Also the problem only happens when the map is zoomed in and the marker being searched for is off screen.

@stefanocudini
Copy link
Owner

stefanocudini commented Aug 26, 2016

I don't understood the problem... do you have a code jsfiddle/pastebin or a demo online?

@TranquilAbyss TranquilAbyss changed the title moveToLocation not Refreshing Lables moveToLocation not Refreshing Labels Aug 27, 2016
@TranquilAbyss
Copy link
Author

This maybe a Leaflet Label problem or just a general Leaflet problem of some kind. I found a similar issue over on the Leaflet Label Git. Leaflet/Leaflet.label#142

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

2 participants