Shifted point anchors to be on top of portals

This commit is contained in:
Nihal Mirpuri 2013-09-24 15:13:56 +10:00
parent d008e37200
commit bac7ef7d22

View File

@ -29,28 +29,34 @@ window.plugin.overlayKML.loadExternals = function() {
try { console.log('Loading KML JS now'); } catch(e) {} try { console.log('Loading KML JS now'); } catch(e) {}
@@INCLUDERAW:external/KML.js@@ @@INCLUDERAW:external/KML.js@@
try { console.log('done loading KML JS'); } catch(e) {} try { console.log('done loading KML JS'); } catch(e) {}
try { console.log('Loading togeojson JS now'); } catch(e) {} try { console.log('Loading togeojson JS now'); } catch(e) {}
@@INCLUDERAW:external/togeojson.js@@ @@INCLUDERAW:external/togeojson.js@@
try { console.log('done loading togeojson JS'); } catch(e) {} try { console.log('done loading togeojson JS'); } catch(e) {}
window.plugin.overlayKML.load(); window.plugin.overlayKML.load();
} }
// window.plugin.overlayKML.setupCallback = function() {
// $('#toolbox').append(' <a onclick="window.plugin.overlayKML.load()" title="Load KML to overlay on top of Ingress Intel Map">Overlay KML</a>');
// }
window.plugin.overlayKML.load = function() { window.plugin.overlayKML.load = function() {
// Provide popup window allow user to select KML to overlay // Provide popup window allow user to select KML to overlay
L.Control.FileLayerLoad.LABEL = 'O';
L.Control.fileLayerLoad({ L.Icon.Default.imagePath = '@@INCLUDEIMAGE:images/marker-icon.png@@';
fitBounds: true, var KMLIcon = L.icon({
layerOptions: { iconUrl: '@@INCLUDEIMAGE:images/marker-icon.png@@',
pointToLayer: function (data, latlng) {
return L.marker(latlng); iconSize: [16, 24], // size of the icon
}}, iconAnchor: [8, 24], // point of the icon which will correspond to marker's location
}).addTo(map); popupAnchor: [-3, 16] // point from which the popup should open relative to the iconAnchor
});
L.Control.FileLayerLoad.LABEL = 'O';
L.Control.fileLayerLoad({
fitBounds: true,
layerOptions: {
pointToLayer: function (data, latlng) {
return L.marker(latlng, {icon: KMLIcon});
}},
}).addTo(map);
} }
var setup = function() { var setup = function() {
@ -59,4 +65,4 @@ var setup = function() {
// PLUGIN END ////////////////////////////////////////////////////////// // PLUGIN END //////////////////////////////////////////////////////////
@@PLUGINEND@@ @@PLUGINEND@@