quick-n-dirty display of min link length instead of portal level for zoom levels <= 14
fix detection of tiles per edge params - array was shorter than before
This commit is contained in:
parent
42d5eb4e2f
commit
58a512823f
@ -50,10 +50,10 @@ window.extractFromStock = function() {
|
|||||||
}
|
}
|
||||||
if (justInts) {
|
if (justInts) {
|
||||||
|
|
||||||
// current lengths are: 17: ZOOM_TO_LEVEL, 16: TILES_PER_EDGE
|
// current lengths are: 17: ZOOM_TO_LEVEL, 14: TILES_PER_EDGE
|
||||||
// however, slightly longer or shorter are a possibility in the future
|
// however, slightly longer or shorter are a possibility in the future
|
||||||
|
|
||||||
if (topObject.length >= 15 && topObject.length <= 18) {
|
if (topObject.length >= 13 && topObject.length <= 18) {
|
||||||
// a reasonable array length for tile parameters
|
// a reasonable array length for tile parameters
|
||||||
// need to find two types:
|
// need to find two types:
|
||||||
// a. portal level limits. decreasing numbers, starting at 8
|
// a. portal level limits. decreasing numbers, starting at 8
|
||||||
@ -74,7 +74,8 @@ window.extractFromStock = function() {
|
|||||||
}
|
}
|
||||||
} // end if (topObject[0] == 8)
|
} // end if (topObject[0] == 8)
|
||||||
|
|
||||||
if (topObject[topObject.length-1] == 36000 || topObject[topObject.length-1] == 18000 || topObject[topObject.length-1] == 9000) {
|
// 2015-06-25 - changed to top value of 64000 - allow for them to double it just in case
|
||||||
|
if (topObject[topObject.length-1] >= 9000 && topObject[topObject.length-1] <= 128000) {
|
||||||
var increasing = true;
|
var increasing = true;
|
||||||
for (var i=1; i<topObject.length; i++) {
|
for (var i=1; i<topObject.length; i++) {
|
||||||
if (topObject[i-1] > topObject[i]) {
|
if (topObject[i-1] > topObject[i]) {
|
||||||
|
@ -7,15 +7,44 @@ window.renderUpdateStatusTimer_ = undefined;
|
|||||||
window.renderUpdateStatus = function() {
|
window.renderUpdateStatus = function() {
|
||||||
var progress = 1;
|
var progress = 1;
|
||||||
|
|
||||||
// portal level display
|
// portal/limk level display
|
||||||
var t = '<span class="help portallevel" title="Indicates portal levels displayed. Zoom in to display lower level portals.">';
|
|
||||||
if(!window.isSmartphone()) // space is valuable
|
var zoom = map.getZoom();
|
||||||
t += '<b>portals</b>: ';
|
zoom = getDataZoomForMapZoom(zoom);
|
||||||
|
|
||||||
|
var minLinkLength;
|
||||||
|
if (zoom <= 4) minLinkLength = 200000;
|
||||||
|
else if (zoom <= 6) minLinkLength = 60000;
|
||||||
|
else if (zoom <= 7) minLinkLength = 10000;
|
||||||
|
else if (zoom <= 8) minLinkLength = 5000;
|
||||||
|
else if (zoom <= 10) minLinkLength = 2500;
|
||||||
|
else if (zoom <= 11) minLinkLength = 800;
|
||||||
|
else if (zoom <= 12) minLinkLength = 300;
|
||||||
|
else if (zoom <= 14) minLinkLength = 0; // 0 means 'all links, but not all portals'
|
||||||
|
else minLinkLength = -1; // -1 means 'all links and portals by min level'
|
||||||
|
|
||||||
var minlvl = getMinPortalLevel();
|
var minlvl = getMinPortalLevel();
|
||||||
if(minlvl === 0)
|
|
||||||
t+= '<span id="loadlevel">all</span>';
|
|
||||||
else
|
var t = '<span class="help portallevel" title="Indicates portal levels/link lengths displayed. Zoom in to display more.">';
|
||||||
t+= '<span id="loadlevel" style="background:'+COLORS_LVL[minlvl]+'">L'+minlvl+(minlvl<8?'+':'') + '</span>';
|
|
||||||
|
if (minLinkLength == -1) {
|
||||||
|
if(!window.isSmartphone()) // space is valuable
|
||||||
|
t += '<b>portals</b>: ';
|
||||||
|
if(minlvl === 0)
|
||||||
|
t += '<span id="loadlevel">all</span>';
|
||||||
|
else
|
||||||
|
t += '<span id="loadlevel" style="background:'+COLORS_LVL[minlvl]+'">L'+minlvl+(minlvl<8?'+':'') + '</span>';
|
||||||
|
} else {
|
||||||
|
if(!window.isSmartphone()) // space is valuable
|
||||||
|
t += '<b>links</b>: ';
|
||||||
|
|
||||||
|
if (minLinkLength > 0)
|
||||||
|
t += '<span id="loadlevel">>'+(minLinkLength>1000?minLinkLength/1000+'km':minLinkLength+'m')+'</span>';
|
||||||
|
else
|
||||||
|
t += '<span id="loadlevel">all links</span>';
|
||||||
|
}
|
||||||
|
|
||||||
t +='</span>';
|
t +='</span>';
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user