30 lines
860 B
TypeScript
30 lines
860 B
TypeScript
// 地图默认配置
|
|
export const defaultOption = {
|
|
center: [108.660704, 36.386058], //地图中心点
|
|
zoom: 6.5, //地图显示的缩放级别
|
|
mapStyle: 'darkblue', //地图样式
|
|
};
|
|
export const YinChuanOption = {
|
|
center: [106.32, 38.45], //地图中心点
|
|
zoom: 8, //地图显示的缩放级别
|
|
mapStyle: 'darkblue', //地图样式
|
|
};
|
|
|
|
// 地图key
|
|
export const mapKey = '4bbcb216b889f2d612cbed05ae6979c8';
|
|
// 地图插件
|
|
export const mapPlugin = ['AMap.ToolBar', 'AMap.Driving', 'AMap.GeoJSON', 'AMap.MarkerCluster', 'AMap.PlaceSearch', 'AMap.Driving', 'AMap.Geocoder'];
|
|
|
|
//根据数据量设置地图层级
|
|
export function getZoom(list = []) {
|
|
let len = list.length;
|
|
// console.log('len', len)
|
|
if (len <= 5) {
|
|
return 7.5;
|
|
} else if (len <= 30) {
|
|
return 6.7;
|
|
} else {
|
|
return 7;
|
|
}
|
|
}
|