如何在Azure地图中使用坐标添加多边形图层。

huangapple go评论50阅读模式
英文:

How to add polygon layers with the coordinates in azure maps

问题

I'm using azure maps controls npm package. I've added the code to render the polygon layer.

我正在使用Azure地图控件的npm包。我已添加了用于渲染多边形图层的代码。

英文:

I'm using azure maps controls npm package. I've added the code to render the polygon layer.

For some polygons the layer is coming up as expected. For some layer is not coming as expected. For some layer is coming up on zooming.
Following this approach to render the polygon layer.

https://github.com/Azure-Samples/AzureMapsCodeSamples/blob/main/Samples/Polygons/Simple%20MultiPolygon/Simple%20MultiPolygon.html

I'm using azure maps controls npm package. I've added the code to render the polygon layer

答案1

得分: 1

以下是翻译好的部分:

"That sample adds a single MultiPolygon to the map, not several individual polygons, so if one displays, they all should display. If you are adding additional individual polygons, note that those use a 3D array while MultiPolygons use a 4D array. Verify your polygon is valid GeoJSON here: https://geojson.io/"

"我无法复现您所看到的问题,使用示例中的代码。您能复制/粘贴您正在使用的代码吗?因为肯定存在一些差异。"

"一些尝试方法:"

  • "尝试缩放和平移,也许问题中的多边形不在视图内。"
  • "尝试清除浏览器缓存。Azure Maps示例站点正在使用Web SDK的预览版本(V3),有时在返回v2时会出现一些加载资源的冲突。"
  • "检查开发工具控制台是否有错误信息。"
英文:

That sample adds a single MultiPolygon to the map, not several individual polygons, so if one displays, they all should display. If you are adding additional individual polygons, note that those use a 3D array while MultiPolygons use a 4D array. Verify your polygon is valid GeoJSON here: https://geojson.io/

I'm not able to reproduce the issue you are seeing using the code in the sample. Can you copy/paste the code you are using as there has to be some differences.

Some things to try:

  • Try zooming and panning around, perhaps the polygon in question isn't in view.
  • Try clearing your browser cache. The Azure Maps sample site is using a preview version of the web SDK (V3) and sometimes there is some conflicts with loaded resources when going back to v2.
  • Check the dev tool console for errors.

huangapple
  • 本文由 发表于 2023年7月6日 18:47:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/76628015.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定