Smaller status bar to suit mobile and further tweaked scale bar position for small mobile displays.
This commit is contained in:
parent
cb66801d9f
commit
a150d54dd7
11
code/boot.js
11
code/boot.js
@ -232,13 +232,10 @@ window.setupMap = function() {
|
||||
localStorage['ingress.intelmap.type']=selInd;
|
||||
});
|
||||
|
||||
// map update status handling
|
||||
map.on('movestart zoomstart', function() { window.mapRunsUserAction = true });
|
||||
map.on('moveend zoomend', function() { window.mapRunsUserAction = false });
|
||||
|
||||
// update map hooks
|
||||
map.on('movestart zoomstart', function() { window.requests.abort(); window.startRefreshTimeout(-1); });
|
||||
map.on('moveend zoomend', function() { window.startRefreshTimeout(ON_MOVE_REFRESH*1000) });
|
||||
// map update status handling & update map hooks
|
||||
// ensures order of calls
|
||||
map.on('movestart zoomstart', function() { window.mapRunsUserAction = true; window.requests.abort(); window.startRefreshTimeout(-1); });
|
||||
map.on('moveend zoomend', function() { window.mapRunsUserAction = false; window.startRefreshTimeout(ON_MOVE_REFRESH*1000); });
|
||||
|
||||
window.addResumeFunction(window.requestData);
|
||||
window.requests.addRefreshFunction(window.requestData);
|
||||
|
@ -39,17 +39,24 @@ window.requests.abort = function() {
|
||||
// to website. Updates info in layer chooser.
|
||||
window.renderUpdateStatus = function() {
|
||||
|
||||
var t = '<b>map status:</b> ';
|
||||
if(mapRunsUserAction)
|
||||
t += 'paused during interaction';
|
||||
else if(isIdle())
|
||||
t += '<span style="color:#888">Idle, not updating.</span>';
|
||||
else if(window.activeRequests.length > 0)
|
||||
t += window.activeRequests.length + ' requests running.';
|
||||
else if(window.requests._quickRefreshPending)
|
||||
t += 'refreshing...';
|
||||
var t = '<div><b>portals:</b> ';
|
||||
var minlvl = getMinPortalLevel();
|
||||
if(minlvl === 0)
|
||||
t += 'all';
|
||||
else
|
||||
t += 'Up to date. <a style="cursor: pointer" onclick="startRefreshTimeout(10)" title="Refresh">⟳</a>';
|
||||
t+= 'L'+minlvl+'+';
|
||||
|
||||
t += ' <b>map:</b> ';
|
||||
if(mapRunsUserAction)
|
||||
t += 'paused';
|
||||
else if(isIdle())
|
||||
t += '<span style="color:#888">Idle</span>';
|
||||
else if(window.activeRequests.length > 0)
|
||||
t += window.activeRequests.length + ' updates';
|
||||
else if(window.requests._quickRefreshPending)
|
||||
t += 'refreshing';
|
||||
else
|
||||
t += 'Up to date';
|
||||
|
||||
if(renderLimitReached())
|
||||
t += ' <span style="color:#f66" class="help" title="Can only render so much before it gets unbearably slow. Not all entities are shown. Zoom in or increase the limit (search for MAX_DRAWN_*).">RENDER LIMIT</span> '
|
||||
@ -57,20 +64,15 @@ window.renderUpdateStatus = function() {
|
||||
if(window.failedRequestCount > 0)
|
||||
t += ' <span style="color:#f66">' + window.failedRequestCount + ' failed</span>.'
|
||||
|
||||
t += '<br/>(';
|
||||
var minlvl = getMinPortalLevel();
|
||||
if(minlvl === 0)
|
||||
t += 'loading all portals';
|
||||
else
|
||||
t+= 'only loading portals with level '+minlvl+' and up';
|
||||
t += ')';
|
||||
|
||||
t += '</div>';
|
||||
var portalSelection = $('.leaflet-control-layers-overlays label');
|
||||
portalSelection.slice(0, minlvl+1).addClass('disabled').attr('title', 'Zoom in to show those.');
|
||||
portalSelection.slice(minlvl, 8).removeClass('disabled').attr('title', '');
|
||||
|
||||
|
||||
$('#updatestatus').html(t);
|
||||
//$('#updatestatus').click(function() { startRefreshTimeout(10); });
|
||||
//. <a style="cursor: pointer" onclick="startRefreshTimeout(10)" title="Refresh">⟳</a>';
|
||||
}
|
||||
|
||||
|
||||
|
@ -28,7 +28,7 @@ window.plugin.scaleBar.setup = function() {
|
||||
// are worse than Internet Explorer 6 whirring fans combined. Upgrade to the metric
|
||||
// system already.
|
||||
if (window.isSmartphone()) {
|
||||
$('head').append('<style>.leaflet-control-scale { position: absolute; bottom: 15px; left: 0px; } </style>');
|
||||
$('head').append('<style>.leaflet-control-scale { position: absolute; bottom: 15px; left: 0px; margin-bottom: 20px !important; } </style>');
|
||||
window.map.addControl(new L.Control.Scale({position: 'bottomleft', imperial: false, maxWidth: 200}));
|
||||
} else {
|
||||
$('head').append('<style>.leaflet-control-scale { position: absolute; top: 2px; left: 40px; } </style>');
|
||||
|
Loading…
x
Reference in New Issue
Block a user