Open orangemug opened 5 years ago
Hi @ahocevar I wonder if there is any interest in adding the functionality mentioned this ticket? It seems to work really well in Maputnik with projections enabled (see demo). I'm happy to help in any way I can to get projections supported.
Maptiler has sample code https://cloud.maptiler.com/maps/ (login to get access to the code) using tiles designed for non-EPSG:3857 projections where the tilegrid options are hardcoded. Ordnance Survey have an EPSG:27700 example which creates the tilegrid from the json https://github.com/OrdnanceSurvey/OS-Data-Hub-API-Demos/blob/master/OSVectorTileAPI/OpenLayers/map.js
I wanted to use vector tiles with another projection other than
EPSG:3857
, so here's my take on how we could add support for that.Support two new fields
ol:projection
/ol:extent
, extentions to the mapbox-gl style spec. So an example source would look like thisThe idea of namespacing with
ol:extent
instead of justextent
is presumably the spec might supportextent
in future in a different format.There is a branch which supports this new extension over at https://github.com/openlayers/ol-mapbox-style/compare/master...orangemug:feature/add-projections, happy to raise a PR if you like the approach.
I've also added this to a Maputnik branch, you can see a demo action and see a write up here https://github.com/maputnik/editor/pull/529 .
Let me know your thoughts