|
|
@@ -21,7 +21,7 @@
|
|
|
:loading-tip="t('common.loadingText')"
|
|
|
>
|
|
|
<MarkerCluster>
|
|
|
- <template v-if="form.type === 0">
|
|
|
+ <!-- <template v-if="form.type === 0">
|
|
|
<CustomMarker
|
|
|
v-for="(location, i) in locations"
|
|
|
:key="i"
|
|
|
@@ -45,7 +45,16 @@
|
|
|
}"
|
|
|
@click="handleMarkerClick(location)"
|
|
|
/>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
+ <AdvancedMarker
|
|
|
+ v-for="(location, i) in locations"
|
|
|
+ :key="i"
|
|
|
+ :options="{
|
|
|
+ position: { lat: location.lat, lng: location.lng },
|
|
|
+ title: location.title,
|
|
|
+ }"
|
|
|
+ @click="handleMarkerClick(location)"
|
|
|
+ />
|
|
|
</MarkerCluster>
|
|
|
|
|
|
<!-- <CustomControl position="TOP_LEFT">
|
|
|
@@ -129,25 +138,19 @@
|
|
|
GoogleMap,
|
|
|
AdvancedMarker,
|
|
|
MarkerCluster,
|
|
|
- CustomMarker,
|
|
|
+ // CustomMarker,
|
|
|
// InfoWindow,
|
|
|
// CustomControl,
|
|
|
} from 'vue3-google-map';
|
|
|
import { useRouteQuery } from '@vueuse/router';
|
|
|
- // import { Select, SelectOption, Popover } from 'ant-design-vue';
|
|
|
- // import ApiSelect from '/@/components/Form/src/components/ApiSelect.vue';
|
|
|
- // import { useRouter } from 'vue-router';
|
|
|
+
|
|
|
const loadingRef = ref(true);
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
import { GetShareMapApi } from '/@/api/mapOpt/list';
|
|
|
- // import { QrCode } from '/@/components/Qrcode/index';
|
|
|
- // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
|
|
|
- // import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
const { t } = useI18n();
|
|
|
- // const router = useRouter();
|
|
|
+
|
|
|
const googleKey = computed(() => import.meta.env.VITE_GOOGLE_KEY);
|
|
|
const center = { lat: 35.717, lng: 139.731 };
|
|
|
- // const { createMessage } = useMessage();
|
|
|
|
|
|
const lang = useRouteQuery('lang', '');
|
|
|
|
|
|
@@ -237,20 +240,37 @@
|
|
|
data.webSite && window.open(data.webSite);
|
|
|
};
|
|
|
const getMarkerData = (data) => {
|
|
|
- return data.map((item) => {
|
|
|
- const mapper = {} as any;
|
|
|
- mapper.lat = Number(item.lat);
|
|
|
- mapper.lng = Number(item.lon);
|
|
|
- mapper.title = item.title;
|
|
|
- mapper.webSite = item.webSite;
|
|
|
- return mapper;
|
|
|
- });
|
|
|
+ if (Number(type.value) === 0) {
|
|
|
+ const list = Array.from(data as any as any[])
|
|
|
+ .reduce((p: string[], c: { sceneList: any[] }) => p.concat(c['sceneList']), [])
|
|
|
+ .map((item) => {
|
|
|
+ const mapper = {} as any;
|
|
|
+ mapper.lat = Number(item.lat);
|
|
|
+ mapper.lng = Number(item.lon);
|
|
|
+ mapper.title = item.title;
|
|
|
+ item.num && (mapper.num = item.num);
|
|
|
+ item.id && (mapper.id = item.id);
|
|
|
+ mapper.webSite = item.webSite;
|
|
|
+ return mapper;
|
|
|
+ });
|
|
|
+ console.log('getMarkerData-list', list);
|
|
|
+ return list;
|
|
|
+ } else {
|
|
|
+ return data.map((item) => {
|
|
|
+ const mapper = {} as any;
|
|
|
+ mapper.lat = Number(item.lat);
|
|
|
+ mapper.lng = Number(item.lon);
|
|
|
+ mapper.title = item.title;
|
|
|
+ mapper.webSite = item.webSite;
|
|
|
+ return mapper;
|
|
|
+ });
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
const sceneFetch = async (params) => {
|
|
|
const res = await GetShareMapApi(params);
|
|
|
const data = getMarkerData(res);
|
|
|
- console.log('result', data.length);
|
|
|
+ console.log('sceneFetch-res', data.length);
|
|
|
locations.value = data;
|
|
|
return res;
|
|
|
};
|