Use standard tile coords
This commit is contained in:
@@ -77,7 +77,7 @@ fetch(url).then(function(response) {
|
||||
tileLoadFunction: function(tile) {
|
||||
const format = tile.getFormat();
|
||||
const tileCoord = tile.getTileCoord();
|
||||
const data = tileIndex.getTile(tileCoord[0], tileCoord[1], -tileCoord[2] - 1);
|
||||
const data = tileIndex.getTile(tileCoord[0], tileCoord[1], tileCoord[2]);
|
||||
|
||||
const features = format.readFeatures(
|
||||
JSON.stringify({
|
||||
|
||||
@@ -21,7 +21,7 @@ function tileUrlFunction(tileCoord) {
|
||||
'{z}/{x}/{y}.vector.pbf?access_token=' + key)
|
||||
.replace('{z}', String(tileCoord[0] * 2 - 1))
|
||||
.replace('{x}', String(tileCoord[1]))
|
||||
.replace('{y}', String(-tileCoord[2] - 1))
|
||||
.replace('{y}', String(tileCoord[2]))
|
||||
.replace('{a-d}', 'abcd'.substr(
|
||||
((tileCoord[1] << tileCoord[0]) + tileCoord[2]) % 4, 1));
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ const map = new Map({
|
||||
tileUrlFunction: function(tileCoord) {
|
||||
return urlTemplate.replace('{z}', (tileCoord[0] - 1).toString())
|
||||
.replace('{x}', tileCoord[1].toString())
|
||||
.replace('{y}', (-tileCoord[2] - 1).toString());
|
||||
.replace('{y}', tileCoord[2].toString());
|
||||
},
|
||||
wrapX: true
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user