|
@@ -15,7 +15,7 @@ export function useAMap(options) {
|
|
|
let layers = [];
|
|
|
let defaultLayer;
|
|
|
// 标绘图层
|
|
|
- let plotLayers = [];
|
|
|
+ const plotLayers = [];
|
|
|
// 标绘层级
|
|
|
let activeLayerkey;
|
|
|
// 初始化事件
|
|
@@ -325,21 +325,19 @@ export function useAMap(options) {
|
|
|
});
|
|
|
};
|
|
|
const getContent = (icon: string, size: number[], name?: string, color?: string = '#000') => {
|
|
|
- const content =
|
|
|
- '<div style="display: flex;flex-direction: column;align-items: center;justify-content: center">' +
|
|
|
+ let content =
|
|
|
+ '<div style="display: flex;flex-direction: column;align-items: center;justify-content: center;cursor: pointer">' +
|
|
|
'<div style="background: url(' +
|
|
|
icon +
|
|
|
') no-repeat; width: ' +
|
|
|
size[0] +
|
|
|
'px;height: ' +
|
|
|
size[1] +
|
|
|
- 'px;cursor: pointer; background-size: cover"></div>' +
|
|
|
- '<div style="font-size: 16px;white-space: nowrap; font-weight: bold;color:' +
|
|
|
- color +
|
|
|
- '">' +
|
|
|
- name +
|
|
|
- '</div>' +
|
|
|
- '</div>';
|
|
|
+ 'px;cursor: pointer; background-size: cover"></div>';
|
|
|
+ if (!!name) {
|
|
|
+ content += '<div style="font-size: 16px;white-space: nowrap; font-weight: bold;color:' + color + '">' + name + '</div>';
|
|
|
+ }
|
|
|
+ content += '</div>';
|
|
|
return content;
|
|
|
};
|
|
|
// 清除所有标加
|