Skip to content

Commit

Permalink
fix: 修复吸附点计算问题 (#182)
Browse files Browse the repository at this point in the history
* build: 修复 rollup 升级导致 umd 报错问题

* fix: 修复吸附点计算报错问题
  • Loading branch information
heiyexing authored Jul 29, 2024
1 parent 9e9e884 commit 688ebe6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 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,
};
3 changes: 2 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
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 688ebe6

Please sign in to comment.