|
@@ -93,6 +93,8 @@ export function useAMap(options) {
|
|
context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2));
|
|
context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2));
|
|
context.marker.setContent(div);
|
|
context.marker.setContent(div);
|
|
context.marker.on('click', (e) => {
|
|
context.marker.on('click', (e) => {
|
|
|
|
+ const bounds = e.target.getBounds();
|
|
|
|
+ map.setZoomAndCenter(map.getZoom() + 1, bounds.getCenter());
|
|
});
|
|
});
|
|
};
|
|
};
|
|
const _renderMarker = function (context) {
|
|
const _renderMarker = function (context) {
|
|
@@ -239,12 +241,12 @@ export function useAMap(options) {
|
|
];
|
|
];
|
|
options.forEach((option) => {
|
|
options.forEach((option) => {
|
|
const holes = result.districtList[0].boundaries;
|
|
const holes = result.districtList[0].boundaries;
|
|
- if (option.offset) {
|
|
|
|
-
|
|
|
|
- holes.forEach((items) => {
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ // if (option.offset) {
|
|
|
|
+ //
|
|
|
|
+ // holes.forEach((items) => {
|
|
|
|
+ //
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
let pathArray = [outer];
|
|
let pathArray = [outer];
|
|
pathArray.push.apply(pathArray, holes);
|
|
pathArray.push.apply(pathArray, holes);
|
|
const polygon = new AMap.Polygon({
|
|
const polygon = new AMap.Polygon({
|