Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无地图模式移动Marker出错 #2492

Closed
readgo opened this issue May 22, 2024 · 4 comments
Closed

无地图模式移动Marker出错 #2492

readgo opened this issue May 22, 2024 · 4 comments
Assignees

Comments

@readgo
Copy link

readgo commented May 22, 2024

沙盒地址:https://codesandbox.io/p/sandbox/lucid-kepler-lt8w6r?file=%2Findex.js%3A11%2C6
错误日志
TypeError
Cannot destructure property 'lng' of 'e.lnglat' as it is undefined.
at Map.eval (https://lt8w6r.csb.app/node_modules/
antv/l7-component/es/marker.js:43:19
Map.emit
https://lt8w6r.csb.app/node_modules/eventemitter3/index.js:181:35
at BlockableMapEventHandler.mousemove (https://lt8w6r.csb.app/node_modules/
antv/l7-map/es/handler/blockable_map_event.js:20:14
at HTMLDivElement.eval (https://lt8w6r.csb.app/node_modules/
antv/l7-map/es/handler/handler_manager.js:92:39
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error.
This error overlay is powered by react-error-overlay used in create-react-app.

代码
import { Scene, PointLayer, Marker } from "@antv/l7";
import { Map } from "@antv/l7-maps";

const scene = new Scene({
id: "map",
map: new Map({
style: "light",
center: [121, 31],
zoom: 14.89,
minZoom: 10,
}),
});
scene.on("loaded", () => {
const m_resize = new Marker({
draggable: true,
offsets: [-4, -4],
}).setLnglat({
lng: 121,
lat: 31,
});
scene.addMarker(m_resize);
});

Copy link
Contributor

hi @readgo, welcome!

Copy link
Contributor

Hi @readgo, Please star this repo if you find it useful! Thanks ⭐!
你好~ @readgo 🌟 如果这个仓库对你有帮助,可以给我们点个star支持一下~你的支持对我们来说是最大的鼓励,感谢你的支持与点赞 🌟

@lvisei
Copy link
Member

lvisei commented May 22, 2024

重复问题 #2487

@lvisei
Copy link
Member

lvisei commented Jun 11, 2024

@antv/[email protected] 已修复

@lvisei lvisei closed this as completed Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants