|
@@ -1,44 +1,44 @@
|
|
|
'use client'
|
|
'use client'
|
|
|
import React, {useEffect} from 'react';
|
|
import React, {useEffect} from 'react';
|
|
|
import SubTitle from "@/components/subTitle";
|
|
import SubTitle from "@/components/subTitle";
|
|
|
-import {BDMapGL} from "@/utils/BDMap";
|
|
|
|
|
|
|
+// import {BDMapGL} from "@/utils/BDMap";
|
|
|
import Image from "next/image";
|
|
import Image from "next/image";
|
|
|
|
|
|
|
|
function ContactUs({basicInfo, locationInfoList}: { basicInfo: BasicInfo, locationInfoList: LocationInfo[] }) {
|
|
function ContactUs({basicInfo, locationInfoList}: { basicInfo: BasicInfo, locationInfoList: LocationInfo[] }) {
|
|
|
const BASE_URL: string = process.env.NEXT_PUBLIC_BASE_URL as string;
|
|
const BASE_URL: string = process.env.NEXT_PUBLIC_BASE_URL as string;
|
|
|
|
|
|
|
|
- const BDMapInit = () => {
|
|
|
|
|
- BDMapGL('94KOPB1NRjoXmLvlJN6HMi7eVC50z09K').then((BMapGL: any) => {
|
|
|
|
|
- const map = new BMapGL.Map('container')
|
|
|
|
|
- locationInfoList.forEach(point => {
|
|
|
|
|
- const bmapPoint = new BMapGL.Point(point.longitude, point.latitude);
|
|
|
|
|
- const marker = new BMapGL.Marker(bmapPoint);
|
|
|
|
|
-
|
|
|
|
|
- // 创建信息窗口(内容可自定义 HTML)
|
|
|
|
|
- const infoWindow = new BMapGL.InfoWindow(`
|
|
|
|
|
- <div>
|
|
|
|
|
- <h4>姓名:${point.name}</h4>
|
|
|
|
|
- <p style="margin: 5px 0 0; color: #666;">区域:${point.marker}</p>
|
|
|
|
|
- <p style="margin: 5px 0 10px; color: #666;">联系方式:${point.phone}</p>
|
|
|
|
|
- </div>
|
|
|
|
|
- `);
|
|
|
|
|
-
|
|
|
|
|
- // 绑定点击事件:点击标记点显示信息窗口
|
|
|
|
|
- marker.addEventListener("click", () => {
|
|
|
|
|
- map.openInfoWindow(infoWindow, bmapPoint); // 在点位坐标处打开窗口
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- map.centerAndZoom(bmapPoint, 7)
|
|
|
|
|
- map.enableScrollWheelZoom(true) //设置鼠标放大缩小
|
|
|
|
|
- map.addControl(new BMapGL.ScaleControl()) //卡尺
|
|
|
|
|
- map.addOverlay(marker)
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // const BDMapInit = () => {
|
|
|
|
|
+ // BDMapGL('94KOPB1NRjoXmLvlJN6HMi7eVC50z09K').then((BMapGL: any) => {
|
|
|
|
|
+ // const map = new BMapGL.Map('container')
|
|
|
|
|
+ // locationInfoList.forEach(point => {
|
|
|
|
|
+ // const bmapPoint = new BMapGL.Point(point.longitude, point.latitude);
|
|
|
|
|
+ // const marker = new BMapGL.Marker(bmapPoint);
|
|
|
|
|
+ //
|
|
|
|
|
+ // // 创建信息窗口(内容可自定义 HTML)
|
|
|
|
|
+ // const infoWindow = new BMapGL.InfoWindow(`
|
|
|
|
|
+ // <div>
|
|
|
|
|
+ // <h4>姓名:${point.name}</h4>
|
|
|
|
|
+ // <p style="margin: 5px 0 0; color: #666;">区域:${point.marker}</p>
|
|
|
|
|
+ // <p style="margin: 5px 0 10px; color: #666;">联系方式:${point.phone}</p>
|
|
|
|
|
+ // </div>
|
|
|
|
|
+ // `);
|
|
|
|
|
+ //
|
|
|
|
|
+ // // 绑定点击事件:点击标记点显示信息窗口
|
|
|
|
|
+ // marker.addEventListener("click", () => {
|
|
|
|
|
+ // map.openInfoWindow(infoWindow, bmapPoint); // 在点位坐标处打开窗口
|
|
|
|
|
+ // });
|
|
|
|
|
+ //
|
|
|
|
|
+ // map.centerAndZoom(bmapPoint, 7)
|
|
|
|
|
+ // map.enableScrollWheelZoom(true) //设置鼠标放大缩小
|
|
|
|
|
+ // map.addControl(new BMapGL.ScaleControl()) //卡尺
|
|
|
|
|
+ // map.addOverlay(marker)
|
|
|
|
|
+ // });
|
|
|
|
|
+ //
|
|
|
|
|
+ // })
|
|
|
|
|
+ // }
|
|
|
const qrCodeUrl = BASE_URL + basicInfo.qrCodeUrl
|
|
const qrCodeUrl = BASE_URL + basicInfo.qrCodeUrl
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
- BDMapInit()
|
|
|
|
|
|
|
+ // BDMapInit()
|
|
|
}, []);
|
|
}, []);
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|