Google 地图 - 加载多边形缓慢
我有一个包含 127 个简单多边形的 KML。
如果我通过 GGeoXml 将它们全部加载,那么速度会快如闪电,当您放大/缩小时,它会立即重新绘制所有多边形(几乎)。
当我使用 EGeoXml 或 CsGeoXml 类时,放大/缩小会变得很慢(大约 4-6 秒),因为它一次重绘多边形 20-30 左右。
我需要将自定义信息窗口放在每个标记上,因此 GGeoXML 并不能真正满足我的需求。
GGeoXML 是否以与上述类不同的方式加载多边形?或者 EGeoXml/CsGeoXml 是否加载/附加 GGeoXml 不加载/附加的内容,导致它们运行速度慢得多?
我还尝试从 KML 文件中获取形状,将它们放入 JSON 文件中并解析 - 同样的问题。
有什么想法/建议吗?
I've got a KML with 127 simple polygons in it.
If I load them all in via GGeoXml then it's lightning fast, and when you zoom in/out it redraws all the polygons (just about) instantly.
When I use either EGeoXml or CsGeoXml classes then zooming in/out becomes slow (about 4-6 seconds) as it redraws the polygons 20-30 or so at a time.
I need to put custom info windows onto each marker so GGeoXML doesn't really cut it for me.
Does GGeoXML load polygons in differently to the above classes somehow? Or does EGeoXml/CsGeoXml load/attach something that GGeoXml doesn't, causing them to go much slower?
I've also tried taking the shapes from a KML file, putting them into a JSON file and parsing that - same problem.
Any thoughts/suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在某些情况下,GGeoXml 服务器将选择渲染多边形以在服务器上平铺图像,并将它们作为客户端的平铺图层提供服务。这对于客户端扩展来说是不可能的。
如果您只想在标记上自定义信息窗口,那么您可以将标记放入一个 KML 文件中,将多边形放入另一个 KML 文件中。使用 GGeoXml 渲染多边形并使用客户端扩展渲染标记。
In some circumstances, the GGeoXml server will choose to render polygons to tile images on the server and serve them as a tile layer to the client. That's not possible for client side extensions.
If you just want custom info windows on the markers, then you could put your markers in one KML file and your polygons in another. Render the polygons with GGeoXml and the markers with a client side extension.