Loading src/components/GMap.vue +4 −75 Original line number Diff line number Diff line Loading @@ -18,74 +18,9 @@ <script> import { defineComponent } from "vue"; // import { useStore } from 'vuex'; import { useStore } from 'vuex'; import { GoogleMap, Polyline, Circle, Marker } from "vue3-google-map"; // import axios from 'axios'; // let result // result = // { // "crossing_point": [ // { lat: 1.5745, lng: 190.326 } // ], // "route1": [ // { "lat": 37.772, "lng": -122.214 }, // { "lat": 21.291, "lng": -157.821 }, // { "lat": -18.142, "lng": 178.431 }, // { "lat": -27.467, "lng": 153.027 } // ], // "route2": [ // { "lat": 37.772, "lng": 153.027 }, // { "lat": 21.291, "lng": 178.431 }, // { "lat": -18.142, "lng": -157.821 }, // { "lat": -27.467, "lng": -122.214 } // ] // } let result = { "data1": [ { "crossing_point": [ { "lat": 37.2239683, "lng": 127.1818492 } ], "route1": [ { "lat": 37.2239683, "lng": 127.1818492 }, { "lat": 37.2239683, "lng": 127.1818492 } ], "route2": [ { "lat": 37.6718673, "lng": 126.7373022 }, { "lat": 37.2368425, "lng": 127.1863072 }, { "lat": 37.2239683, "lng": 127.1818492 }, { "lat": 37.2239683, "lng": 127.1818492 } ] } ] } // console.log(result); export default defineComponent({ Loading @@ -97,12 +32,6 @@ export default defineComponent({ }; }, // created() { // // Retrieve the data from Vuex // this.result = this.$store.state.data.data1; // // console.log(result); // }, methods: { showMapMethod() { this.showMap = true; Loading @@ -111,15 +40,15 @@ export default defineComponent({ setup() { // const store = useStore(); // const result = JSON.parse(JSON.stringify(store.state.data.data1))[0]; const store = useStore(); const result = JSON.parse(JSON.stringify(store.state.data.data1))[0]; // console.log(result); // console.log(JSON.parse(JSON.stringify(result))) // console.log(result.crossing_point[0]); // console.log(result.data1[0]) result = result.data1[0]; // result = result.data1[0]; let center = result.crossing_point[0]; console.log(center); Loading Loading
src/components/GMap.vue +4 −75 Original line number Diff line number Diff line Loading @@ -18,74 +18,9 @@ <script> import { defineComponent } from "vue"; // import { useStore } from 'vuex'; import { useStore } from 'vuex'; import { GoogleMap, Polyline, Circle, Marker } from "vue3-google-map"; // import axios from 'axios'; // let result // result = // { // "crossing_point": [ // { lat: 1.5745, lng: 190.326 } // ], // "route1": [ // { "lat": 37.772, "lng": -122.214 }, // { "lat": 21.291, "lng": -157.821 }, // { "lat": -18.142, "lng": 178.431 }, // { "lat": -27.467, "lng": 153.027 } // ], // "route2": [ // { "lat": 37.772, "lng": 153.027 }, // { "lat": 21.291, "lng": 178.431 }, // { "lat": -18.142, "lng": -157.821 }, // { "lat": -27.467, "lng": -122.214 } // ] // } let result = { "data1": [ { "crossing_point": [ { "lat": 37.2239683, "lng": 127.1818492 } ], "route1": [ { "lat": 37.2239683, "lng": 127.1818492 }, { "lat": 37.2239683, "lng": 127.1818492 } ], "route2": [ { "lat": 37.6718673, "lng": 126.7373022 }, { "lat": 37.2368425, "lng": 127.1863072 }, { "lat": 37.2239683, "lng": 127.1818492 }, { "lat": 37.2239683, "lng": 127.1818492 } ] } ] } // console.log(result); export default defineComponent({ Loading @@ -97,12 +32,6 @@ export default defineComponent({ }; }, // created() { // // Retrieve the data from Vuex // this.result = this.$store.state.data.data1; // // console.log(result); // }, methods: { showMapMethod() { this.showMap = true; Loading @@ -111,15 +40,15 @@ export default defineComponent({ setup() { // const store = useStore(); // const result = JSON.parse(JSON.stringify(store.state.data.data1))[0]; const store = useStore(); const result = JSON.parse(JSON.stringify(store.state.data.data1))[0]; // console.log(result); // console.log(JSON.parse(JSON.stringify(result))) // console.log(result.crossing_point[0]); // console.log(result.data1[0]) result = result.data1[0]; // result = result.data1[0]; let center = result.crossing_point[0]; console.log(center); Loading