This commit is contained in:
zk
2024-05-17 16:10:51 +08:00
parent ce2b8f5837
commit 7444e6ff75
18 changed files with 125 additions and 76 deletions
+1
View File
@@ -31,6 +31,7 @@ export const Map = {
}).then((res) => {
AMap = res;
const { zoom, center, mapStyle } = { ...defaultOption, ...option };
console.log('option', option, center);
//基本地图加载
this.map = new AMap.Map(el, {
resizeEnable: true,
+4 -4
View File
@@ -1,16 +1,16 @@
// 地图默认配置
// 西安地图默认配置
export const defaultOption = {
center: [108.660704, 36.386058], //地图中心点
// center: [108.660704, 36.386058], //地图中心点
zoom: 6.5, //地图显示的缩放级别
mapStyle: 'darkblue', //地图样式
};
// 地图key
export const mapKey = '4bbcb216b889f2d612cbed05ae6979c8'
export const mapKey = '4bbcb216b889f2d612cbed05ae6979c8';
export const mapPlugin = ['AMap.ToolBar', 'AMap.Driving', 'AMap.GeoJSON', 'AMap.MarkerCluster', 'AMap.PlaceSearch'];
//根据数据量设置地图层级
export function getZoom(list = []) {
let len = list.length
let len = list.length;
// console.log('len', len)
if (len <= 5) {
return 7.5;