Google Maps mangling KML

前端 未结 2 1908
挽巷
挽巷 2021-01-21 19:02

I\'ve created KML files of some world regions for display using the Google Maps API. This has been working fine, but one region has recently started displaying as if the data\'s

相关标签:
2条回答
  • 2021-01-21 19:18

    I thought I was going crazy. This was working for years until some days ago. I agree it seems to be where polygons cross the "international date line" or anti-meridian. I see straight lines horizontally across the map. Furthermore I swapped out my KML file for another from a different source, SAME problem. Thanks for restoring my sanity, I wasted a stressful day trying to fix this, I think it is a Google problem. ps. they work fine in Google Earth.

    0 讨论(0)
  • 2021-01-21 19:32

    I would say that the Google Maps KML rendering engine has some issues. It works when I use the geoxml3 third party parser to render it, but not when I use the Google Maps Javascript API v3 KmlLayer to render it.

    rendered with geoxml3

    Note that the performance with third party parsers will depend on the complexity of the KML. Tile base rendering like used in KmlLayer will almost always perform better.

    issue #8003 in the Google Maps Javascript API ve issue tracker

    0 讨论(0)
提交回复
热议问题