merge patch from #491, that updates things to getThinnedEntitiesV4
also a couple of plugins that were missed
This commit is contained in:
@ -216,12 +216,12 @@ window.requestData = function() {
|
||||
return 0;
|
||||
});
|
||||
|
||||
data = { zoom: z };
|
||||
data = { };
|
||||
data.boundsParamsList = tls;
|
||||
// keep a list of tile_ids with each request. in the case of a server error, we can try and use cached tiles if available
|
||||
var tile_ids = []
|
||||
$.each(tls,function(i,req) { tile_ids.push(req.qk); });
|
||||
window.requests.add(window.postAjax('getThinnedEntitiesV3', data, function(data, textStatus, jqXHR) { window.handleDataResponse(data,false,tile_ids); }, function() { window.handleFailedRequest(tile_ids); }));
|
||||
window.requests.add(window.postAjax('getThinnedEntitiesV4', data, function(data, textStatus, jqXHR) { window.handleDataResponse(data,false,tile_ids); }, function() { window.handleFailedRequest(tile_ids); }));
|
||||
});
|
||||
|
||||
// process the requests from the cache
|
||||
@ -255,7 +255,7 @@ window.handleFailedRequest = function(tile_ids) {
|
||||
handleDataResponse(cachedData, true);
|
||||
}
|
||||
|
||||
if(requests.isLastRequest('getThinnedEntitiesV3')) {
|
||||
if(requests.isLastRequest('getThinnedEntitiesV4')) {
|
||||
var leftOverPortals = portalRenderLimit.mergeLowLevelPortals(null);
|
||||
handlePortalsRender(leftOverPortals);
|
||||
}
|
||||
|
@ -10,20 +10,20 @@
|
||||
// http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
|
||||
|
||||
window.lngToTile = function(lng, zoom) {
|
||||
return Math.floor((lng + 180) / 360 * Math.pow(2, zoom));
|
||||
return Math.floor((lng + 180) / 360 * Math.pow(2, (zoom>12)?zoom:(zoom+2)));
|
||||
}
|
||||
|
||||
window.latToTile = function(lat, zoom) {
|
||||
return Math.floor((1 - Math.log(Math.tan(lat * Math.PI / 180) +
|
||||
1 / Math.cos(lat * Math.PI / 180)) / Math.PI) / 2 * Math.pow(2, zoom));
|
||||
1 / Math.cos(lat * Math.PI / 180)) / Math.PI) / 2 * Math.pow(2, (zoom>12)?zoom:(zoom+2)));
|
||||
}
|
||||
|
||||
window.tileToLng = function(x, zoom) {
|
||||
return x / Math.pow(2, zoom) * 360 - 180;
|
||||
return x / Math.pow(2, (zoom>12)?zoom:(zoom+2)) * 360 - 180;
|
||||
}
|
||||
|
||||
window.tileToLat = function(y, zoom) {
|
||||
var n = Math.PI - 2 * Math.PI * y / Math.pow(2, zoom);
|
||||
var n = Math.PI - 2 * Math.PI * y / Math.pow(2, (zoom>12)?zoom:(zoom+2));
|
||||
return 180 / Math.PI * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n)));
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ window.portalRenderLimit.splitOrMergeLowLevelPortals = function(originPortals) {
|
||||
portalRenderLimit.resetCounting();
|
||||
portalRenderLimit.countingPortals(originPortals);
|
||||
|
||||
var resultPortals = requests.isLastRequest('getThinnedEntitiesV3')
|
||||
var resultPortals = requests.isLastRequest('getThinnedEntitiesV4')
|
||||
? portalRenderLimit.mergeLowLevelPortals(originPortals)
|
||||
: portalRenderLimit.splitLowLevelPortals(originPortals);
|
||||
|
||||
|
Reference in New Issue
Block a user