Merge pull request #7023 from ahocevar/vectortile-sizes
Update tile size and resolutions of vector tile examples
This commit is contained in:
@@ -17,7 +17,7 @@ var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
|
|||||||
|
|
||||||
// Calculation of resolutions that match zoom levels 1, 3, 5, 7, 9, 11, 13, 15.
|
// Calculation of resolutions that match zoom levels 1, 3, 5, 7, 9, 11, 13, 15.
|
||||||
var resolutions = [];
|
var resolutions = [];
|
||||||
for (var i = 0; i <= 7; ++i) {
|
for (var i = 0; i <= 8; ++i) {
|
||||||
resolutions.push(156543.03392804097 / Math.pow(2, i * 2));
|
resolutions.push(156543.03392804097 / Math.pow(2, i * 2));
|
||||||
}
|
}
|
||||||
// Calculation of tile urls for zoom levels 1, 3, 5, 7, 9, 11, 13, 15.
|
// Calculation of tile urls for zoom levels 1, 3, 5, 7, 9, 11, 13, 15.
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ var map = new ol.Map({
|
|||||||
'© <a href="https://www.openstreetmap.org/copyright">' +
|
'© <a href="https://www.openstreetmap.org/copyright">' +
|
||||||
'OpenStreetMap contributors</a>',
|
'OpenStreetMap contributors</a>',
|
||||||
format: new ol.format.MVT(),
|
format: new ol.format.MVT(),
|
||||||
tileGrid: ol.tilegrid.createXYZ({maxZoom: 22}),
|
tileGrid: ol.tilegrid.createXYZ({tileSize: 512, maxZoom: 22}),
|
||||||
tilePixelRatio: 16,
|
tilePixelRatio: 8,
|
||||||
url: 'https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
|
url: 'https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
|
||||||
'{z}/{x}/{y}.vector.pbf?access_token=' + key
|
'{z}/{x}/{y}.vector.pbf?access_token=' + key
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ var map = new ol.Map({
|
|||||||
layerName: 'layer',
|
layerName: 'layer',
|
||||||
layers: ['water', 'roads', 'buildings']
|
layers: ['water', 'roads', 'buildings']
|
||||||
}),
|
}),
|
||||||
tileGrid: ol.tilegrid.createXYZ({maxZoom: 19}),
|
tileGrid: ol.tilegrid.createXYZ({tileSize: 512, maxZoom: 19}),
|
||||||
url: 'https://tile.mapzen.com/mapzen/vector/v1/all/{z}/{x}/{y}.topojson?api_key=' + key
|
url: 'https://tile.mapzen.com/mapzen/vector/v1/all/{z}/{x}/{y}.topojson?api_key=' + key
|
||||||
}),
|
}),
|
||||||
style: function(feature, resolution) {
|
style: function(feature, resolution) {
|
||||||
|
|||||||
Reference in New Issue
Block a user