Delete Feature
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
<EditButton icon="fas fa-save" v-on:click="save" :show="editing" tooltip="Save"></EditButton>
|
||||
|
||||
<EditButton icon="fas fa-draw-polygon" v-on:click="drawPolyline" :show="editing" tooltip="Draw Taxiline"></EditButton>
|
||||
<EditButton icon="fas fas fa-parking" v-on:click="drawParking" :show="editing" tooltip="Draw Parking"></EditButton>
|
||||
<EditButton icon="fas fa-parking" v-on:click="drawParking" :show="editing" tooltip="Draw Parking"></EditButton>
|
||||
<EditButton icon="fas fa-trash-alt" v-on:click="deleteFeature" :show="editing" tooltip="Remove"></EditButton>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -38,6 +39,9 @@
|
||||
},
|
||||
drawParking () {
|
||||
this.$parent.$parent.$refs.editLayer.drawParking()
|
||||
},
|
||||
deleteFeature () {
|
||||
this.$parent.$parent.$refs.editLayer.deleteFeature()
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -96,6 +96,11 @@
|
||||
l.disableEdit()
|
||||
})
|
||||
},
|
||||
deleteFeature () {
|
||||
this.groundnetLayerGroup.eachLayer(l => {
|
||||
l.on('click', this.removeLayerClick)
|
||||
})
|
||||
},
|
||||
drawPolyline () {
|
||||
var polyLine = this.$parent.mapObject.editTools.startPolyline()
|
||||
polyLine.addTo(this.groundnetLayerGroup)
|
||||
@@ -103,6 +108,10 @@
|
||||
drawParking () {
|
||||
this.$parent.mapObject.on('click', this.addParking)
|
||||
},
|
||||
removeLayerClick (event) {
|
||||
console.log(event)
|
||||
this.groundnetLayerGroup.removeLayer(event.target)
|
||||
},
|
||||
addParking (event) {
|
||||
console.log(event.latlng)
|
||||
if (event.latlng === undefined) {
|
||||
|
||||
Reference in New Issue
Block a user