liuhj 4 months ago
parent
commit
4f490604cc
1 changed files with 17 additions and 1 deletions
  1. 17 1
      src/components/statistics/Statistically.vue

+ 17 - 1
src/components/statistics/Statistically.vue

@@ -368,6 +368,7 @@
 import { getToken } from 'mapkit-token';
 import * as echarts from 'echarts';
 export default {
+    name: 'PlaceDetail',
     data () {
         return {
             fullscreenLoading:false,
@@ -610,6 +611,20 @@ export default {
             // document.body.appendChild(oScript);
             this.onlinemap();
         },
+        async displayPlaceDetail() {
+            const placeId = "I63802885C8189B2B"; // 替换为你的Place ID
+            const lookup = new mapkit.PlaceLookup();
+            lookup.getPlace(placeId, (error, place) => {
+                if (error) {
+                    console.error('Error fetching place:', error);
+                    return;
+                }
+                const placeDetailElement = document.getElementById("map");
+                const placeDetail = new mapkit.PlaceDetail(placeDetailElement, place, {
+                    colorScheme: mapkit.PlaceDetail.ColorSchemes.Adaptive
+                });
+            });
+        },
         //在线地图
         onlinemap(){
             // var token="eyJraWQiOiI1NEIyRkFLODMzIiwidHlwIjoiSldUIiwiYWxnIjoiRVMyNTYifQ.eyJpc3MiOiJIS0YzNzJKU01LIiwiaWF0IjoxNzMzMTkxMzI2LCJvcmlnaW4iOiJvYS5wYW4tYW1lcmljYW4taW50bC5jb20ifQ.1czYQb-Nxh6n4kG9sVylQH32XawN92gBKXjn6i_SU0F2M9fpwbStM-gDRvfANEiEUDz5ogUmm_FQf9eBF8o9Zg";
@@ -637,7 +652,7 @@ export default {
             //     countryCode: "CN",
             //     isZoomEnabled:true,
             // })
-            this.map = new mapkit.Map("map", {
+            this.map = new mapkit.Map("map", { 
                 center: new mapkit.Coordinate(104.096488, 30.635261),
                 showsMapTypeControl: true,
                 showsZoomControl: true,
@@ -1430,6 +1445,7 @@ export default {
     },
     mounted(){
         this.StatisticsYOY();
+        this.displayPlaceDetail();
         // this.countrieschange(this.value);
         // this.StatisticsOP(1);
         // this.StatisticsAirTicket();