Jared Norris 8 年之前
父節點
當前提交
16fa75c6d1
共有 1 個檔案被更改,包括 5 行新增6 行删除
  1. 5
    6
      VueApp/src/components/GoogleMap.vue

+ 5
- 6
VueApp/src/components/GoogleMap.vue 查看文件

@@ -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