commenthol / leaflet-rastercoords

Leaflet plugin for plain image map projection to display large images using tiles generated with gdal2tiles-leaflet
https://commenthol.github.io/leaflet-rastercoords
MIT License
120 stars 23 forks source link

Create method to get max bounds #10

Closed takvol closed 2 years ago

takvol commented 2 years ago

Hi, thanks for plugin Aim of this PR is to address the issues #7 and #9 by adding crs and getMaxBounds (new method) to examples

To prevent fetching the tiles outside of the image, the bounds can be obtained from rc object Also, looks like the map bounds are not 100% correct without crs: L.CRS.Simple map property. For example, if the image is tall, it gets cropped at the bottom without crs: https://codesandbox.io/s/eloquent-tree-0htxi?file=/scripts.js with crs: https://codesandbox.io/s/boring-banach-o7nk0?file=/scripts.js

commenthol commented 2 years ago

@takvol thanks for this contribution.