mirror of
				https://github.com/KevinMidboe/nova-map-fields.git
				synced 2025-10-29 17:50:27 +00:00 
			
		
		
		
	Only show control when edit
This commit is contained in:
		| @@ -5,7 +5,7 @@ | |||||||
|             <l-polygon :lat-lngs="value" :visible="true" /> |             <l-polygon :lat-lngs="value" :visible="true" /> | ||||||
|         </field-map> |         </field-map> | ||||||
|  |  | ||||||
|         <l-control position="bottomleft" > |         <l-control position="bottomleft" v-if="edit"> | ||||||
|             <button @click="removeLastMarker"> |             <button @click="removeLastMarker"> | ||||||
|             Slett forrige |             Slett forrige | ||||||
|             </button> |             </button> | ||||||
| @@ -78,13 +78,15 @@ export default { | |||||||
|         triggerChange() { |         triggerChange() { | ||||||
|             this.$emit('input', this.markers); |             this.$emit('input', this.markers); | ||||||
|         }, |         }, | ||||||
|         removeLastMarker() { |         removeLastMarker(event) { | ||||||
|             this.markers.splice(-1,1); |             this.markers.splice(-1,1); | ||||||
|             this.triggerChange(); |             this.triggerChange(); | ||||||
|  |             event.preventDefault(); | ||||||
|         }, |         }, | ||||||
|         removeAllMarkers() { |         removeAllMarkers(event) { | ||||||
|             this.markers = []; |             this.value = []; | ||||||
|             this.triggerChange(); |             this.triggerChange(); | ||||||
|  |             event.preventDefault(); | ||||||
|         }, |         }, | ||||||
|         createMarker(evt) { |         createMarker(evt) { | ||||||
|             this.markers.push(evt.latlng); |             this.markers.push(evt.latlng); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user