update
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user