Remove last & all marker buttons

This commit is contained in:
2021-09-05 22:08:02 +00:00
parent 218bea2aeb
commit 0c22a4127f
2 changed files with 10 additions and 6 deletions

2
dist/js/field.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -6,8 +6,11 @@
</field-map>
<l-control position="bottomleft" >
<button @click="clickHandler">
I am a useless button!
<button @click="removeLastMarker">
Slett forrige
</button>
<button @click="removeAllMarkers">
Slett alle
</button>
</l-control>
</div>
@@ -79,13 +82,14 @@ export default {
this.markers.splice(-1,1);
this.triggerChange();
},
removeAllMarkers() {
this.markers = [];
this.triggerChange();
},
createMarker(evt) {
this.markers.push(evt.latlng);
this.triggerChange();
},
clickHandler() {
alert('clicked');
},
},
components: {