maptiler / tileserver-gl

Vector and raster maps with GL styles. Server side rendering by MapLibre GL Native. Map tile server for MapLibre GL JS, Android, iOS, Leaflet, OpenLayers, GIS via WMTS, etc.
https://tileserver.readthedocs.io/en/latest/
Other
2.22k stars 636 forks source link

Projection of non-Earth fantasy vector maps without distortion #627

Open zned45 opened 1 year ago

zned45 commented 1 year ago

I am currently working on a project related to a game. We have a non-earth square vector map created in QGIS which we are trying to serve using tileserver-gl

After copy the .mbtiles into the folder, I get the following spec with EPSG:3857 projection despite tiles being exported with no CRS.

{
  "tiles": ["http://localhost:8080/data/Map/{z}/{x}/{y}.pbf"],
  "name": "unnamed",
  "format": "pbf",
  "basename": "Map.mbtiles",
  "id": "Map",
  "vector_layers": [{ "fields": { "id": "Number" }, "id": "land" }],
  "type": "baselayer",
  "minzoom": 2,
  "maxzoom": 2,
  "bounds": [-0.000741689, -0.000646808, 0.000739646, 0.000650274],
  "crs": "EPSG:3857",
  "center": [-0.0000010214999999999834, 0.0000017329999999999646, 2],
  "tilejson": "2.0.0"
}

The effect of this is that the map get stretched vertically (seen with the server MapLibre visualizer. There is any way to serve the tiles with a custom projection or no projection at all? Is Tileserver GL even the right tool to achieve this?

Thank you.

acalcutt commented 1 year ago

If you were using a rendered mode, there is a reprojection that happens here ( https://github.com/maptiler/tileserver-gl/blob/master/src/serve_rendered.js#L772 ).

But if you are just loading data from the mbtiles file like you are I don't think tileserver-gl reprojects, but I do think Maplibre-GL still needs EPSG:3857, so maybe because it's not what it expects it gets distorted?