I'm trying to use OpenLayers to display vector tile layers and basemaps that I've created and am serving.
The raster basemaps I'm using are in EPSG:4326, and I'd like to overlay the MVT layers, reprojected into EPSG:4326 as well.
However, it's not seeming to work. When I have a map with the view projection set to EPSG:3857, everything looks fine. The basemap, which is in EPSG:4326, is reprojected to EPSG:3857 and the vector layer looks exactly right.
But when I change the map view projection to EPSG:4326, the raster basemap looks okay, but the MVT layer will not display. No tile requests are made, and I get no JS errors.
I have the projection
attribute of my MVT source set to EPSG:3857
. I've tried defining my own TileGrid as well as ol.tilegrid.createXYZ()
, but nothing works when the main map view projection is set to EPSG:4326.
I know MVT support in OpenLayers is fairly new, perhaps this isn't something supported yet?
I'm trying to do this because my vector data was originally in EPSG:4326. I have to convert it to EPSG:3857 in order to serve it as MVT tiles, but I'd like to be able to show it in its original projection.