don't create layer groups until the setup function is called. if a plugin is processed before IITC core script, leaflet isn't available
fix #460
This commit is contained in:
parent
d177c27a6d
commit
42316ca0e9
@ -2,7 +2,7 @@
|
||||
// @id iitc-plugin-portal-level-numbers@rongou
|
||||
// @name IITC plugin: Portal Level Numbers
|
||||
// @category Layer
|
||||
// @version 0.1.0.@@DATETIMEVERSION@@
|
||||
// @version 0.1.1.@@DATETIMEVERSION@@
|
||||
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
||||
// @updateURL @@UPDATEURL@@
|
||||
// @downloadURL @@DOWNLOADURL@@
|
||||
@ -22,7 +22,7 @@
|
||||
window.plugin.portalLevelNumbers = function() {};
|
||||
|
||||
window.plugin.portalLevelNumbers.levelLayers = {};
|
||||
window.plugin.portalLevelNumbers.levelLayerGroup = new L.LayerGroup();
|
||||
window.plugin.portalLevelNumbers.levelLayerGroup = null;
|
||||
|
||||
// Use portal add and remove event to control render of portal level numbers
|
||||
window.plugin.portalLevelNumbers.portalAdded = function(data) {
|
||||
@ -76,6 +76,8 @@ var setup = function() {
|
||||
}")
|
||||
.appendTo("head");
|
||||
|
||||
window.plugin.portalLevelNumbers.levelLayerGroup = new L.LayerGroup();
|
||||
|
||||
window.addLayerGroup('Portal Levels', window.plugin.portalLevelNumbers.levelLayerGroup, true);
|
||||
|
||||
window.addHook('portalAdded', window.plugin.portalLevelNumbers.portalAdded);
|
||||
|
Loading…
x
Reference in New Issue
Block a user