We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
代码如下
import { LarkMap, LayerPopup, PointLayer, ScaleControl, ZoomControl } from '@antv/larkmap'; import type { LarkMapProps, LayerPopupProps, PointLayerProps } from '@antv/larkmap'; import {MapLibre} from "@antv/l7"; const config: LarkMapProps = { map: new MapLibre({ zoom: 10, style: 'https://api.maptiler.com/maps/streets/style.json?key=YbCPLULzWdf1NplssEIc', minZoom: 0, maxZoom: 18, }), }
我这么设置MapLibre,结果地图显示不了,然后控制台报错 Uncaught ReferenceError: _wrapNativeSuper is not defined 只显示了背景,没地图
Uncaught ReferenceError: _wrapNativeSuper is not defined
The text was updated successfully, but these errors were encountered:
完整代码
import React, { useEffect, useState } from "react"; import { LarkMap, LayerPopup, PointLayer, ScaleControl, ZoomControl } from '@antv/larkmap'; import type { LarkMapProps, LayerPopupProps, PointLayerProps } from '@antv/larkmap'; import {MapLibre} from "@antv/l7"; const config: LarkMapProps = { map: new MapLibre({ zoom: 10, style: 'https://api.maptiler.com/maps/streets/style.json?key=YbCPLULzWdf1NplssEIc', minZoom: 0, maxZoom: 18, }), }; const items: LayerPopupProps['items'] = [ { layer: 'PolygonLayer', fields: [ { field: 'province', formatField: '省份', }, { field: 'busStop', formatField: '城市', }, { field: 'address', formatField: '站点', }, { field: 'lng', formatField: '经度', },{ field: 'lat', formatField: '纬度', }, ] } ]; const pointLayerProps: Omit<PointLayerProps, 'source'> = { id: 'myPointLayer', shape: 'circle', size: 7, color: { field: 'address', value: ['#34B6B7', '#CEF8D6'], }, state: { active: { color: 'pink', // 设置鼠标划过点的颜色 }, }, autoFit: true, style: { opacity: 0.7, }, blend: 'normal', }; const RealTimeTradeMap: React.FC = () => { const [data, setData] = useState({ data: [], parser: { type: 'json', x: 'lng', y: 'lat', }, }); useEffect(() => { fetch('https://gw.alipayobjects.com/os/bmw-prod/d5ec85b7-3ac6-4987-924a-3952d7e31bcb.json') .then((res) => res.json()) .then((dataArr) => { setData({ ...data, data: dataArr }); }); }, []); return ( <LarkMap {...config} style={{ height: '60vh' }}> <PointLayer {...pointLayerProps} source={data} id="PolygonLayer" /> <ScaleControl /> <ZoomControl /> <LayerPopup closeButton={false} closeOnClick={false} anchor="bottom-left" title={<div>图层数据</div>} trigger="hover" items={items} /> </LarkMap> ) } export default RealTimeTradeMap;
Sorry, something went wrong.
lvisei
No branches or pull requests
代码如下
我这么设置MapLibre,结果地图显示不了,然后控制台报错
![企业微信截图_20240607174443](https://private-user-images.githubusercontent.com/11335550/337608995-722d5dd4-2136-4e27-892f-e869d792184f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3MzE0OTYsIm5iZiI6MTcyNDczMTE5NiwicGF0aCI6Ii8xMTMzNTU1MC8zMzc2MDg5OTUtNzIyZDVkZDQtMjEzNi00ZTI3LTg5MmYtZTg2OWQ3OTIxODRmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI3VDAzNTk1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY1ZDEzYTUzZTI0MDlhY2IzNTE1NjZhMWQwZGJlYmMwNWQ4ZjljOTVmM2NmMjIyZTdhOWI3NWRiZTdkNWE2ODkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.eJZrPHwdxFamxiuipKvmHCqWx11SHWbYungKknwXPug)
Uncaught ReferenceError: _wrapNativeSuper is not defined
只显示了背景,没地图
The text was updated successfully, but these errors were encountered: