kartena / Proj4Leaflet

Smooth Proj4js integration with Leaflet.
http://kartena.github.io/Proj4Leaflet/
BSD 2-Clause "Simplified" License
589 stars 173 forks source link

CRS bounds as an array #161

Closed brentfraser closed 5 years ago

brentfraser commented 5 years ago

I'd like to deliver the options for L.Proj.CRS in a JSON file. In general it works well, but I have to do an eval() on the bounds definition: "bounds": "L.bounds([ [-4194304, -4194304],[4194304, 4194304]])"

It would be nice if it would allow an array like Leaflet does (see https://leafletjs.com/reference-1.4.0.html#bounds): "bounds": [ [-4194304, -4194304],[4194304, 4194304]]

That way I would not have to do the eval().

pthorin commented 5 years ago

This sounds like a nice feature, would you be able to work on it as Pull Request?

brentfraser commented 5 years ago

Created pull request #162

pthorin commented 5 years ago

Thank you for the PR, it's been merged now. You might also be interested in https://github.com/kartena/leaflet-tilejson as well, it configures leaflet based on a tilejson file.

brentfraser commented 5 years ago

Thanks! Interesting stuff. My thoughts/experiments with inventing a JSON format look like a super-set of TileJSON (multiple basemap layers, overlays,etc). I'll have a closer look at leaflet-tilejson.