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

Layer doesn't work correctly in L.FeatureGroup, due to missing _bounds attribute #4

Open
carpiediem opened this issue Mar 23, 2017 · 1 comment

Comments

@carpiediem
Copy link

I tried to include some Leaflet.ImageOverlay.Rotated layers in a feature group, but the L.FeatureGroup methods weren't working correctly. It appears this is due to not getting bounding data from the Leaflet.ImageOverlay.Rotated object.

I was able to make a temporary solution by adding the second line of code, below.

    var overlay = L.imageOverlay.rotated(imageURL, topLeft, topRight, bottomLeft);
    overlay._bounds = L.latLngBounds([topLeft, topRight, bottomRight, bottomLeft]);

Perhaps the library could do this automatically?

@IvanSanchez
Copy link
Owner

This is already done at https://github.com/IvanSanchez/Leaflet.ImageOverlay.Rotated/blob/gh-pages/Leaflet.ImageOverlay.Rotated.js#L129 .

Can you publish a fiddle/codepen/playground that displays this behaviour? That should make it easier to see where the FeatureGroup needs the _bounds, and how to refactor the bounds-calculating code so it can run earlier.

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