我需要反转包含波兰国家/地区的 KML 文件。 我需要在其他国家/地区覆盖白色,只有波兰应该可见。 http://cv.bluewolf.pl/kml-map/ 我在转换边界时遇到问题,并在世界其他地方放置白色覆盖层。只有一个国家(波兰)应该可见。
我尝试使用 geocodezip 中的 KML 缠绕反转工具,但找不到任何教程或文档。 我尝试使用来自 github 的 Mask-KML-polygons 来转换 KML 文件,但这不起作用。
有人能告诉我我可以用什么在 map 上获得这种效果吗? http://www.geocodezip.com/geoxml3_test/v3_geoxml3_NetherlandsInverted.html
最佳答案
根据winding reversal tool , POL_adm0.kml 中的所有多边形都在负方向风向。
name Poland outer -0.000029027214395682677 outer -0.00011758931589156418 outer -0.00004442846750407625 outer -0.0011201874443713677 outer -0.00001914283006954065 outer -0.0002913248119966738 outer -0.000060512058212225384 outer -0.0055139375892849785 outer -0.000024386593850067584 outer -0.000016341876744263573 outer -0.00001358358349534683 outer -0.00022344898320625362 outer -0.010447627167081919 outer -0.0026826606504073425 outer -0.07199650440122696 outer -0.00004660667070766067 outer -0.007425361581113066 outer -81.8301486672533
All you need to do is add an outerBoundaryIs that winds in the opposite direction and change all the existing outerBoundaryIs tags to innerBoundaryIs tags. Here is an <outerBoundaryIs>
that winds in the correct direction:
<outerBoundaryIs><LinearRing><coordinates>
180,85 90,85 0,85 -90,85 -180,85 -180,0 -180,-85 -90,-85 0,-85 90,-85 180,-85 180,0 180,85
</coordinates></LinearRing></outerBoundaryIs>
Updated KMZ file (displayed on a Google Maps Javascript API v3 map)
注意:它适用于 native Google map 多边形(在 geoxml3 中),但不适用于 KmlLayer .
关于javascript - KML 反转国家边界,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35242944/