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

Map bounds limited to the image size #2

Closed
pauloFernandes opened this issue May 9, 2017 · 1 comment
Closed

Map bounds limited to the image size #2

pauloFernandes opened this issue May 9, 2017 · 1 comment

Comments

@pauloFernandes
Copy link

Apparently the plugin sets the map's bounds equals to image's size. When I put a marker on the edges of the image, and it has a popup, the map hides this popup.

Is it possible to create bounds to the map bigger than image's size?

@commenthol
Copy link
Owner

Yes that's possible. Please take a look at the example on https://commenthol.github.io/leaflet-rastercoords. Zooming out gives you the possibility to view the popup.
You can also set map.setMaxBounds() like this: (from example/index.js)

    ...
    // assign map and image dimensions
    var rc = new L.RasterCoords(map, img)

    map.setMaxBounds(rc.unproject([0, 0]), rc.unproject(img))
    // set the view on a marker ...
    map.setView(rc.unproject([0, 0] /*[1589, 1447]*/), 4)

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