mirror of
https://github.com/KevinMidboe/nova-map-fields.git
synced 2026-03-11 09:35:56 +00:00
Remove last & all marker buttons
This commit is contained in:
2
dist/js/field.js
vendored
2
dist/js/field.js
vendored
File diff suppressed because one or more lines are too long
@@ -6,8 +6,11 @@
|
|||||||
</field-map>
|
</field-map>
|
||||||
|
|
||||||
<l-control position="bottomleft" >
|
<l-control position="bottomleft" >
|
||||||
<button @click="clickHandler">
|
<button @click="removeLastMarker">
|
||||||
I am a useless button!
|
Slett forrige
|
||||||
|
</button>
|
||||||
|
<button @click="removeAllMarkers">
|
||||||
|
Slett alle
|
||||||
</button>
|
</button>
|
||||||
</l-control>
|
</l-control>
|
||||||
</div>
|
</div>
|
||||||
@@ -79,13 +82,14 @@ export default {
|
|||||||
this.markers.splice(-1,1);
|
this.markers.splice(-1,1);
|
||||||
this.triggerChange();
|
this.triggerChange();
|
||||||
},
|
},
|
||||||
|
removeAllMarkers() {
|
||||||
|
this.markers = [];
|
||||||
|
this.triggerChange();
|
||||||
|
},
|
||||||
createMarker(evt) {
|
createMarker(evt) {
|
||||||
this.markers.push(evt.latlng);
|
this.markers.push(evt.latlng);
|
||||||
this.triggerChange();
|
this.triggerChange();
|
||||||
},
|
},
|
||||||
clickHandler() {
|
|
||||||
alert('clicked');
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
Reference in New Issue
Block a user