Merge branch 'layerChooser' of https://github.com/hastarin/ingress-intel-total-conversion into hastarin-layerChooser

This commit is contained in:
Jon Atkins 2013-05-08 21:39:29 +01:00
commit 3523abf032
6 changed files with 29 additions and 23 deletions

View File

@ -24,6 +24,6 @@ window.setupGeosearch = function() {
e.preventDefault(); e.preventDefault();
}); });
$('#geosearchwrapper img').click(function(){ $('#geosearchwrapper img').click(function(){
map.locate({setView : true});; map.locate({setView : true, maxZoom: 13});;
}); });
} }

View File

@ -33,7 +33,7 @@ window.portalHighlighterControl = function() {
}); });
$("#portal_highlight_select").val(_current_highlighter); $("#portal_highlight_select").val(_current_highlighter);
$("#portal_highlight_select").change(function(){ changePortalHighlights($(this).val());}); $("#portal_highlight_select").change(function(){ changePortalHighlights($(this).val());});
$(".leaflet-top.leaflet-left").css('padding-top','25px'); $(".leaflet-top.leaflet-left").css('padding-top', '20px');
$(".leaflet-control-scale-line").css('margin-top','25px'); $(".leaflet-control-scale-line").css('margin-top','25px');
} }
} }
@ -61,4 +61,4 @@ window.resetHighlightedPortals = function() {
} }
catch(e) {} catch(e) {}
}); });
} }

View File

@ -77,8 +77,6 @@ window.runOnSmartphonesAfterBoot = function() {
// disable img full view // disable img full view
$('#portaldetails').off('click', '**'); $('#portaldetails').off('click', '**');
$('.leaflet-right').addClass('leaflet-left').removeClass('leaflet-right');
// make buttons in action bar flexible // make buttons in action bar flexible
var l = $('#chatcontrols a:visible'); var l = $('#chatcontrols a:visible');
l.css('width', 100/l.length + '%'); l.css('width', 100/l.length + '%');

View File

@ -1,6 +1,7 @@
// created to start cleaning up "window" interaction // created to start cleaning up "window" interaction
// //
window.show = function(id) { window.show = function(id) {
window.hideall();
switch(id) { switch(id) {
case 'full': case 'full':
window.chat.show('full'); window.chat.show('full');
@ -19,6 +20,7 @@ window.show = function(id) {
break; break;
case 'map': case 'map':
window.smartphone.mapButton.click(); window.smartphone.mapButton.click();
$('#portal_highlight_select').show();
break; break;
case 'info': case 'info':
window.smartphone.sideButton.click(); window.smartphone.sideButton.click();
@ -28,3 +30,8 @@ window.show = function(id) {
break; break;
} }
} }
window.hideall = function() {
$('#chatcontrols, #chat, #chatinput, #sidebartoggle, #scrollwrapper, #updatestatus, #portal_highlight_select').hide();
$('#map').css('visibility', 'hidden');
}

View File

@ -7,18 +7,16 @@ body {
background: #0B3351 !important background: #0B3351 !important
} }
.leaflet-top .leaflet-control {
margin-top: 5px !important;
margin-left: 5px !important;
}
.leaflet-control-layers { .leaflet-control-layers {
margin-left: 0 !important; margin-left: 0 !important;
margin-top: 40px !important; margin-top: 0 !important;
} }
.leaflet-control-zoom {
margin-left: 5px !important;
margin-top: 80px !important;
}
#geosearch { #geosearch {
width: 100%; width: 100%;
} }
@ -126,6 +124,11 @@ body {
display: none; display: none;
} }
.leaflet-control-layers-toggle {
width: 50px !important;
height: 50px !important;
}
.leaflet-control-layers-list label { .leaflet-control-layers-list label {
padding: 6px 0; padding: 6px 0;
} }
@ -135,13 +138,6 @@ body {
} }
#portal_highlight_select{ #portal_highlight_select{
position: absolute; top:0px !important;
top:42px; left:0px !important;
left:310px;
z-index: 9999;
font-size:11px;
font-family: "coda",arial,helvetica,sans-serif;
background-color:#0E3C46;
color:#ffce00;
} }

View File

@ -24,11 +24,16 @@ if(typeof window.plugin !== 'function') window.plugin = function() {};
window.plugin.scaleBar = function() {}; window.plugin.scaleBar = function() {};
window.plugin.scaleBar.setup = function() { window.plugin.scaleBar.setup = function() {
$('head').append('<style>.leaflet-control-scale { position: absolute; top: 2px; left: 40px; } </style>');
// Before you ask: yes, I explicitely turned off imperial units. Imperial units // Before you ask: yes, I explicitely turned off imperial units. Imperial units
// 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.
window.map.addControl(new L.Control.Scale({position: 'topleft', imperial: false, maxWidth: 200})); if (window.isSmartphone()) {
$('head').append('<style>.leaflet-control-scale { position: absolute; bottom: 15px; left: 0px; } </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>');
window.map.addControl(new L.Control.Scale({position: 'topleft', imperial: false, maxWidth: 200}));
}
}; };
var setup = window.plugin.scaleBar.setup; var setup = window.plugin.scaleBar.setup;