谷歌地图 Javascript API 与 KML 层?
是否有关于何时使用 KML 图层或 Javascript API 的一般建议?该应用程序有几个需求。我需要在地图上显示移动对象的标记。这些平均每分钟刷新一次。但会有很多静态标记需要按需显示。这些只是标记。但在另一个屏幕中我需要绘制行驶路线。
实际上我不确定显示所有所需数据的最佳方式是什么。 KML?仅通过 API 动态获取数据和其余部分?在服务器上生成代码,然后上传到浏览器即可。就性能和开发人员的易用性而言,什么是最好的?
Is there any general advice when to use KML layers or the Javascript API? There are several needs for the app. I need to display markers for moving object on the map. These will be refreshed every minute in average. But there will be a lot of static markers to be displayed on demand. These are just markers. But in another screen I need to draw the driven routes.
Actually I'm not sure what's the best way of displaying all the needed data. KML? Only get the data and to the rest by the API on the fly? Generate the code on the server and just upload it to the browser. What would be the best in terms of performance and and easy usage for the developer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为 javascript 层比 kml 更快。
(最快的速度是生成图像图块 - 但这需要大量时间并且需要静态完成)。
我会使用 AJAX 在服务器上生成数据并将其即时发送到 API。
我认为如果您想与其他网站和使用桌面 GIS 软件的人共享数据,KML 很有用。使用别人的 KML 图层非常容易。使用他们的 javascript 数组要困难得多。
I think javascript layers are faster than kml.
(The fastest speed is to generate image tiles - but that takes a lot of time and needs to be done statically).
I'd use AJAX to generate the data on the server and send it to the API on the fly.
I think KML is useful if you want to share the data with other websites and people using desktop GIS software. It is extremely easy to use someone else's KML layer. It is much harder to use their javascript array.