Use L.Contao as reference to the Contao integration object.

This commit is contained in:
David Molineus
2015-01-15 01:10:36 +01:00
parent 8186a0b3ee
commit 6fbc1a9bf3
5 changed files with 36 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
L.Contao = L.Class.extend({
L.Contao = new (L.Class.extend({
includes: L.Mixin.Events,
/**
@@ -117,10 +117,10 @@ L.Contao = L.Class.extend({
loadLayer: function(url, type, options, customLayer, map) {
var layer = omnivore[type](url, options, customLayer);
// Required because Control.Loading tries to get _leafet_id which is created here.
L.stamp(layer);
if (map) {
// Required because Control.Loading tries to get _leafet_id which is created here.
L.stamp(layer);
map.fire('dataloading', { layer: layer });
layer.on('ready', function() {
@@ -225,6 +225,4 @@ L.Contao = L.Class.extend({
};
}
}
});
window.ContaoLeaflet = new L.Contao();
}))();