Skip to content

Commit 1f85fdd

Browse files
author
Nicolò Maria Mezzopera
authored
Merge pull request #377 from KoRiGaN/feature/ready-event
Feature/ready event
2 parents 8dda7ce + 20177ff commit 1f85fdd

File tree

47 files changed

+50
-61
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+50
-61
lines changed

docs/components/events-notice.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/components/l-circle-marker/README.md

Lines changed: 1 addition & 3 deletions

docs/components/l-circle/README.md

Lines changed: 1 addition & 3 deletions

docs/components/l-control-attribution/README.md

Lines changed: 1 addition & 3 deletions

docs/components/l-control-layers/README.md

Lines changed: 1 addition & 3 deletions

docs/components/l-control-scale/README.md

Lines changed: 1 addition & 3 deletions

docs/components/l-control-zoom/README.md

Lines changed: 1 addition & 3 deletions

docs/components/l-control/README.md

Lines changed: 1 addition & 3 deletions

docs/components/l-feature-group/README.md

Lines changed: 1 addition & 3 deletions

docs/components/l-geo-json/README.md

Lines changed: 1 addition & 3 deletions

docs/components/l-grid-layer/README.md

Lines changed: 1 addition & 2 deletions

docs/components/l-icon/README.md

Lines changed: 1 addition & 3 deletions

docs/components/l-image-overlay/README.md

Lines changed: 1 addition & 3 deletions

docs/components/l-map/README.md

Lines changed: 2 additions & 2 deletions

docs/components/l-marker/README.md

Lines changed: 1 addition & 1 deletion

docs/components/l-polygon/README.md

Lines changed: 1 addition & 3 deletions

docs/components/l-polyline/README.md

Lines changed: 1 addition & 3 deletions

docs/components/l-popup/README.md

Lines changed: 1 addition & 3 deletions

docs/components/l-rectangle/README.md

Lines changed: 1 addition & 3 deletions

docs/components/l-tile-layer/README.md

Lines changed: 1 addition & 3 deletions

docs/components/l-tooltip/README.md

Lines changed: 1 addition & 3 deletions

docs/components/l-wms-tile-layer/README.md

Lines changed: 1 addition & 3 deletions

docs/components/shared-events.md

Lines changed: 3 additions & 0 deletions

examples/src/components/LoadTest.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<img
2424
width="300"
2525
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAMAAAC3Ycb+AAACLlBMVEVMaXFBuINBuIM8enI/nnxBuINBuINBuIM8enJBuIM8enJBuINBuINBuIM8enJBuIM8enJBuINBuIM7eXFBuINBuIM8eXFBuINBuIM8eHFBuIM8eXFBuIM8eHBBuIM8eHBBuIM8d3BBuINBuIM8d3BBuINBuINBuIM8dnBBuINBuIM8dnBBuINBuIM7dXBBuINBuIM8dG9BuINBuIM8dG9BuIM8dG9BuINBuIM8c29BuINBuIM7cm5BuINBuIM7cW5BuIM7cW9BuINBuINBuIM7cW5BuINBuINBuIM7b21BuINBuIM6b21BuIM7bm1BuINBuIM7bW1BuINBuIM6bGxBuINBuIM6a2xBuIM6a2xBuINBuIM6amxBuIM6aWtBuINBuIM6aGpBuINBuIM6ZmpBuINBuIM5ZGlBuIM5Y2lBuINBuIM5YWhBuINBuIM5YGdBuIM4XmdBuINBuIM4XGZBuINBuIM4WmVBuIM3WGRBuIM3V2RBuINBuIM3VGNBuIM2UmI2UGFBuIM1TWA1SV41Sl41S141TF81TWA2T2A2UWE2U2I3VWM3WGQ4W2U4Xmc5YGc5YWg5ZGk6Zmo6Z2o6aGo6a2w7bW07bm07cG48c287dnA7eHA8enI8fHI9fnM8gXM9g3Q9hnU9iXY+i3c+jHc+j3g+kXk+lHo/l3o/mXs+m3s/nnw/oH0/o31Apn5BqH5Aqn9BrH9BroBBr4BCsYBBs4FBtoJCt4JBuIP7mHZoAAAAhHRSTlMAAQICAwQHCAgLDQ4QEhIVFhcaGh4hIiUoKissLzEzNDc4Oj4/QERFRkhLTVBTVldaXV5iYmZnaW1vcHV3eHx8gIGDhIeJio+Sk5aZm52foaWmqKyusLS1t7m6u7y/wMLHx8zP0NPW1trc3uLi5Obn6urt7+/y8/T29vf4+vv7/P39/v7L5yYnAAAKeElEQVR42uzBgQAAAADDoPtTH2TVAAAA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ff+hbGvtzNOY0L9AT2FWsX9hXGw2BfgaZhX2E8DPYV6APsK9YF7CuMh8G+Aq3BvsJ4GOwr0G/YVxgPg30Fegn7inUI+wrjYbCvQAuwrzAeBvsK9AX21V9z7bYZPAz2FWgb9hXGw2Bfgf7DvsJ4GOwr0DvYV6wz2FcXD4N9FVqFfVXv5pzGNfrZxL7gYbCvSs9hX7EOetgXPAz2VWquhn3Bw2BfrT7DviRJkiRJkiRJkiRJkiRJkiQNszucKAuToL+DiQAAAABJRU5ErkJggg=="
26-
/>
26+
>
2727
</l-popup>
2828
</l-marker>
2929
</l-map>

src/components/LCircle.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default {
3131
this.ready = true;
3232
this.parentContainer = findRealParent(this.$parent);
3333
this.parentContainer.addLayer(this, !this.visible);
34+
this.$emit('ready', this.mapObject);
3435
},
3536
methods: {}
3637
};

src/components/LCircleMarker.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default {
3535
this.ready = true;
3636
this.parentContainer = findRealParent(this.$parent);
3737
this.parentContainer.addLayer(this, !this.visible);
38+
this.$emit('ready', this.mapObject);
3839
}
3940
};
4041
</script>

src/components/LControl.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export default {
2929
this.parentContainer = findRealParent(this.$parent);
3030
this.mapObject.setElement(this.$el);
3131
this.mapObject.addTo(this.parentContainer.mapObject);
32+
this.$emit('ready', this.mapObject);
3233
}
3334
};
3435
</script>

src/components/LControlAttribution.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default {
2121
this.mapObject = control.attribution(options);
2222
propsBinder(this, this.mapObject, this.$options.props);
2323
this.mapObject.addTo(this.$parent.mapObject);
24+
this.$emit('ready', this.mapObject);
2425
},
2526
render () {
2627
return null;

src/components/LControlLayers.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export default {
4141
this.mapObject = control.layers(null, null, options);
4242
propsBinder(this, this.mapObject, this.$options.props);
4343
this.$parent.registerLayerControl(this);
44+
this.$emit('ready', this.mapObject);
4445
},
4546
methods: {
4647
addLayer (layer) {

src/components/LControlScale.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export default {
3636
this.mapObject = control.scale(options);
3737
propsBinder(this, this.mapObject, this.$options.props);
3838
this.mapObject.addTo(this.$parent.mapObject);
39+
this.$emit('ready', this.mapObject);
3940
},
4041
render () {
4142
return null;

src/components/LControlZoom.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export default {
3636
this.mapObject = control.zoom(options);
3737
propsBinder(this, this.mapObject, this.$options.props);
3838
this.mapObject.addTo(this.$parent.mapObject);
39+
this.$emit('ready', this.mapObject);
3940
},
4041
render () {
4142
return null;

src/components/LFeatureGroup.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default {
2626
if (this.visible) {
2727
this.parentContainer.addLayer(this);
2828
}
29+
this.$emit('ready', this.mapObject);
2930
}
3031
};
3132
</script>

src/components/LGeoJson.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export default {
3737
propsBinder(this, this.mapObject, this.$options.props);
3838
this.parentContainer = findRealParent(this.$parent, true);
3939
this.parentContainer.addLayer(this, !this.visible);
40+
this.$emit('ready', this.mapObject);
4041
},
4142
beforeDestroy () {
4243
this.parentContainer.mapObject.removeLayer(this.mapObject);

src/components/LGridLayer.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export default {
4343
this.mapObject.createTile = this.createTile;
4444
this.parentContainer = findRealParent(this.$parent);
4545
this.parentContainer.addLayer(this, !this.visible);
46+
this.$emit('ready', this.mapObject);
4647
},
4748
beforeDestroy () {
4849
this.parentContainer.removeLayer(this.mapObject);

src/components/LIcon.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export default {
101101
);
102102
103103
this.scheduleCreateIcon();
104+
this.$emit('ready', this.mapObject);
104105
},
105106
106107
beforeDestroy () {

src/components/LIconDefault.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default {
1414
mounted () {
1515
Icon.Default.imagePath = this.imagePath;
1616
propsBinder(this, this.mapObject, this.$options.props);
17+
this.$emit('ready', this.mapObject);
1718
},
1819
methods: {
1920
setImagePath (newVal, oldVal) {

src/components/LImageOverlay.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default {
1313
propsBinder(this, this.mapObject, this.$options.props);
1414
this.parentContainer = findRealParent(this.$parent);
1515
this.parentContainer.addLayer(this, !this.visible);
16+
this.$emit('ready', this.mapObject);
1617
},
1718
render () {
1819
return null;

src/components/LLayerGroup.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default {
2626
if (this.visible) {
2727
this.parentContainer.addLayer(this);
2828
}
29+
this.$emit('ready', this.mapObject);
2930
}
3031
};
3132
</script>

src/components/LMap.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ export default {
156156
DomEvent.on(this.mapObject, this.$listeners);
157157
propsBinder(this, this.mapObject, this.$options.props);
158158
this.ready = true;
159+
// DEPRECATED leaflet:load
159160
this.$emit('leaflet:load');
161+
this.$emit('ready', this.mapObject);
160162
},
161163
methods: {
162164
registerLayerControl (lControlLayers) {

src/components/LMarker.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export default {
5252
this.parentContainer = findRealParent(this.$parent);
5353
this.parentContainer.addLayer(this, !this.visible);
5454
this.ready = true;
55+
this.$emit('ready', this.mapObject);
5556
},
5657
methods: {
5758
setDraggable (newVal, oldVal) {

src/components/LPolygon.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default {
3131
this.ready = true;
3232
this.parentContainer = findRealParent(this.$parent);
3333
this.parentContainer.addLayer(this, !this.visible);
34+
this.$emit('ready', this.mapObject);
3435
}
3536
};
3637
</script>

src/components/LPolyline.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default {
3131
this.ready = true;
3232
this.parentContainer = findRealParent(this.$parent);
3333
this.parentContainer.addLayer(this, !this.visible);
34+
this.$emit('ready', this.mapObject);
3435
}
3536
};
3637
</script>

0 commit comments

Comments
 (0)