|
|
@@ -16,7 +16,6 @@
|
|
16
|
16
|
<button @click="gotoPlace(currentPlace)">scroll to location</button>
|
|
17
|
17
|
<button @click="removeMarkers">clear route</button>
|
|
18
|
18
|
<button @click="locateUser">geolocate</button>
|
|
19
|
|
- <button @click="emitRoute">calculate elevation</button>
|
|
20
|
19
|
</label>
|
|
21
|
20
|
<br/>
|
|
22
|
21
|
</div>
|
|
|
@@ -79,6 +78,11 @@
|
|
79
|
78
|
this.clearMap()
|
|
80
|
79
|
this.markers = []
|
|
81
|
80
|
},
|
|
|
81
|
+ clearMap () {
|
|
|
82
|
+ if (this.directionsDisplay) {
|
|
|
83
|
+ this.directionsDisplay.setMap(null)
|
|
|
84
|
+ }
|
|
|
85
|
+ },
|
|
82
|
86
|
setRoute (a, b) {
|
|
83
|
87
|
this.clearMap()
|
|
84
|
88
|
this.directionsService = new google.maps.DirectionsService() // eslint-disable-line no-undef
|
|
|
@@ -104,11 +108,6 @@
|
|
104
|
108
|
this.emitRoute()
|
|
105
|
109
|
})
|
|
106
|
110
|
},
|
|
107
|
|
- clearMap () {
|
|
108
|
|
- if (this.directionsDisplay) {
|
|
109
|
|
- this.directionsDisplay.setMap(null)
|
|
110
|
|
- }
|
|
111
|
|
- },
|
|
112
|
111
|
emitRoute () {
|
|
113
|
112
|
this.$emit(
|
|
114
|
113
|
'updateRoute', this.directionsDisplay
|