You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#Hi! I'm not able to render a VectorLayer from mapzen, which is provided as TopoJson.
I noticed that the URL is not getting resolved with z,x and y, as my browser is complaining: [Error] Failed to load resource: the server responded with a status of 404 (Not Found) https://tile.mapzen.com/mapzen/vector/v1/512/all/%7Bz%7D/%7Bx%7D/%7By%7D.topojson?api_key=***
How can I specify an OLVectorSource with XYZ?
OLVectorSourceOptions optionsMapzen = new OLVectorSourceOptions();
optionsMapzen.setUrl("https://tile.mapzen.com/mapzen/vector/v1/512/all/{z}/{x}/{y}.topojson?api_key=" + apiKey);
optionsMapzen.setInputProjection(Projections.EPSG4326);
OLFeatureFormat format = OLFeatureFormat.TOPOJSON;
optionsMapzen.setFormat(format);
OLTopoJSONFormatOptions formatOptions = new OLTopoJSONFormatOptions();
formatOptions.setDefaultDataProjection(Projections.EPSG4326);
try {
optionsMapzen.setFormatOptions(formatOptions);
} catch (JsonProcessingException e) {
...
}
OLVectorSource sourceMapZen = new OLVectorSource(optionsMapzen);
OLVectorLayer layerMapzen = new OLVectorLayer(sourceMapZen);
OLStyle style = StyleUtils.createDefaultStyle();
layerMapzen.setStyle(style);
map.addLayer(layerMapzen);
Furthermore, according to this tutorial I am missing the part where to specify the layers:
#Hi! I'm not able to render a VectorLayer from mapzen, which is provided as TopoJson.
I noticed that the URL is not getting resolved with z,x and y, as my browser is complaining:
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) https://tile.mapzen.com/mapzen/vector/v1/512/all/%7Bz%7D/%7Bx%7D/%7By%7D.topojson?api_key=***
How can I specify an OLVectorSource with XYZ?
Furthermore, according to this tutorial I am missing the part where to specify the layers:
Thanks!
The text was updated successfully, but these errors were encountered: