14 Star 160 Fork 43

uiw / react-amap

 / 详情

国家简易行政图图层使用示例

待办的
创建于  
2024-03-02 11:56

如何使用 AMap.DistrictLayer.Country 显示国建简易行政区图层 ?
代码如下:

<Map style={{ height: "calc(100% - 30px)" }} center={center} zoom={zoom} zoomEnable={false} dragEnable={false} keyboardEnable={false}>
{
({ AMap, map, container }) => {
console.log("UserAMapPage AMap => ", AMap);
console.log("UserAMapPage map => ", map);
console.log("UserAMapPage container => ", container);
console.log("UserAMapPage AMap.DistrictLayer => ", AMap.DistrictLayer);
console.log("UserAMapPage AMap.DistrictLayer.Country => ", AMap.DistrictLayer.Country);
return (
<AMap.DistrictLayer.Country
SOC={'CHN'}
depth={2}
adcode={100000}
zIndex={10}
styles={{
'nation-stroke': '#f09', 'coastline-stroke': [0.85, 0.63, 0.94, 1], 'province-stroke': 'white', 'city-stroke': 'rgba(255,255,255,0.15)',
'fill': (props) => {
console.log("UserAMapPage AMap.DistrictLayer.Country fill props => ", props);
return getColorByDGP(props.adcode_pro);
}
}}
/>);
}
}

总是报错,Uncaught TypeError: Cannot set properties of undefined (setting 'vI')

评论 (0)

野性心态 创建了任务

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(1)
JavaScript
1
https://gitee.com/uiw/react-amap.git
git@gitee.com:uiw/react-amap.git
uiw
react-amap
react-amap

搜索帮助