Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into fix/map-tianditu
Browse files Browse the repository at this point in the history
  • Loading branch information
heiyexing committed Jul 29, 2024
2 parents 66aa08a + 688ebe6 commit 1ceb635
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .fatherrc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { optimizeLodashImports } from '@optimize-lodash/rollup-plugin';
import nodePolyfills from 'rollup-plugin-node-polyfills';
// import analyze from 'rollup-plugin-analyzer';

export default {
Expand All @@ -13,6 +14,6 @@ export default {
'@antv/l7': 'L7',
},
},
extraRollupPlugins: [optimizeLodashImports()], //analyze()
extraRollupPlugins: [optimizeLodashImports(), nodePolyfills()], //analyze()
lessInBabelMode: true,
};
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/l7-draw",
"version": "3.1.3",
"version": "3.1.4",
"description": "A drawing package for L7",
"license": "MIT",
"scripts": {
Expand Down Expand Up @@ -63,6 +63,7 @@
"lint-staged": "^10.0.7",
"prettier": "^2.2.1",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-node-polyfills": "^0.2.1",
"yorkie": "^2.0.0"
},
"peerDependencies": {
Expand Down Expand Up @@ -97,6 +98,9 @@
"type": "git",
"url": "https://github.com/antvis/l7-draw"
},
"engines": {
"node": "16"
},
"bugs": {
"url": "https://github.com/antvis/l7-draw/issues"
}
Expand Down
3 changes: 2 additions & 1 deletion src/control/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class DrawControl extends Control {
};
}

public addTo(container: L7Container) {
public addTo(container: any) {
super.addTo(container);
this.init();
return this;
Expand Down Expand Up @@ -250,6 +250,7 @@ export class DrawControl extends Control {
<use xlink:href="${DrawIconMap[type]}"></use>
</svg>`;
btn.setAttribute(DrawTypeAttrName, type);
btn.type = 'button';
return btn;
}
}
4 changes: 4 additions & 0 deletions src/utils/adsorb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ const getAdsorbPoint = (
return isPositionInBBox(position, pointExpandBBox);
});

if (!points.length) {
return null;
}

const [lng, lat] = position;
const { x: mouseX, y: mouseY } = scene.lngLatToPixel([lng, lat]);
const squareDistanceList = points.map((point) => {
Expand Down

0 comments on commit 1ceb635

Please sign in to comment.