Smaller status bar to suit mobile and further tweaked scale bar position for small mobile displays.

This commit is contained in:
hastarin 2013-05-12 14:14:58 +10:00
parent cb66801d9f
commit a150d54dd7
3 changed files with 25 additions and 26 deletions

View File

@ -232,13 +232,10 @@ window.setupMap = function() {
localStorage['ingress.intelmap.type']=selInd; localStorage['ingress.intelmap.type']=selInd;
}); });
// map update status handling // map update status handling & update map hooks
map.on('movestart zoomstart', function() { window.mapRunsUserAction = true }); // ensures order of calls
map.on('moveend zoomend', function() { window.mapRunsUserAction = false }); 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); });
// 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) });
window.addResumeFunction(window.requestData); window.addResumeFunction(window.requestData);
window.requests.addRefreshFunction(window.requestData); window.requests.addRefreshFunction(window.requestData);

View File

@ -39,17 +39,24 @@ window.requests.abort = function() {
// to website. Updates info in layer chooser. // to website. Updates info in layer chooser.
window.renderUpdateStatus = function() { window.renderUpdateStatus = function() {
var t = '<b>map status:</b> '; var t = '<div><b>portals:</b> ';
if(mapRunsUserAction) var minlvl = getMinPortalLevel();
t += 'paused during interaction'; if(minlvl === 0)
else if(isIdle()) t += 'all';
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...';
else 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()) 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> ' 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) if(window.failedRequestCount > 0)
t += ' <span style="color:#f66">' + window.failedRequestCount + ' failed</span>.' t += ' <span style="color:#f66">' + window.failedRequestCount + ' failed</span>.'
t += '<br/>('; t += '</div>';
var minlvl = getMinPortalLevel();
if(minlvl === 0)
t += 'loading all portals';
else
t+= 'only loading portals with level '+minlvl+' and up';
t += ')';
var portalSelection = $('.leaflet-control-layers-overlays label'); var portalSelection = $('.leaflet-control-layers-overlays label');
portalSelection.slice(0, minlvl+1).addClass('disabled').attr('title', 'Zoom in to show those.'); portalSelection.slice(0, minlvl+1).addClass('disabled').attr('title', 'Zoom in to show those.');
portalSelection.slice(minlvl, 8).removeClass('disabled').attr('title', ''); portalSelection.slice(minlvl, 8).removeClass('disabled').attr('title', '');
$('#updatestatus').html(t); $('#updatestatus').html(t);
//$('#updatestatus').click(function() { startRefreshTimeout(10); });
//. <a style="cursor: pointer" onclick="startRefreshTimeout(10)" title="Refresh">⟳</a>';
} }

View File

@ -28,7 +28,7 @@ window.plugin.scaleBar.setup = function() {
// are worse than Internet Explorer 6 whirring fans combined. Upgrade to the metric // are worse than Internet Explorer 6 whirring fans combined. Upgrade to the metric
// system already. // system already.
if (window.isSmartphone()) { 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})); window.map.addControl(new L.Control.Scale({position: 'bottomleft', imperial: false, maxWidth: 200}));
} else { } else {
$('head').append('<style>.leaflet-control-scale { position: absolute; top: 2px; left: 40px; } </style>'); $('head').append('<style>.leaflet-control-scale { position: absolute; top: 2px; left: 40px; } </style>');