Merge pull request #99 from Fragger/pancontrol-tweak

Make the pan control plugin show up a little nicer
This commit is contained in:
Jon Atkins 2013-03-30 10:35:54 -07:00
commit 5558fcd64f
2 changed files with 36 additions and 2 deletions

View File

@ -1,3 +1,30 @@
/* Make the default zoom control align with the pan control.
This is ugly.
The parent box (class="leaflet-top leaflet-left")
should make all the child boxes be center-aligned instead.
Not sure if that is possible though.
*/
.leaflet-bar {
position: relative;
left:23px;
}
/*
Make the zoomSlider control
(https://github.com/mattiasbengtsson/Leaflet.zoomslider)
align with the pan control.
*/
.leaflet-control-zoomslider {
position: relative;
left:22px;
}
/*
override the scale bar and push it over
*/
.leaflet-control-scale {
left: 63px !important;
}
.leaflet-control-pan {
/*
.leaflet-control-pan-right-wrap: right

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @id iitc-plugin-pan-control@fragger
// @name IITC plugin: pan control
// @version 0.1.0.@@DATETIMEVERSION@@
// @version 0.1.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
@ -28,8 +28,15 @@ window.plugin.panControl.setup = function() {
@@INCLUDERAW:external/L.Control.Pan.js@@
try { console.log('done loading Leaflet.Pancontrol JS'); } catch(e) {}
window.map.addControl(L.control.pan({panOffset: 350}));
window.map.panControl = L.control.pan({panOffset: 350});
window.map.addControl(window.map.panControl);
if(map.zoomControl._map) { // Move above the zoom control
window.map.removeControl(map.zoomControl);
window.map.zoomControl = L.control.zoom();
window.map.addControl(window.map.zoomControl);
}
$('head').append('<style>@@INCLUDESTRING:external/L.Control.Pan.css@@</style>');
};