在低缩放级别之前,Google 地图点不会显示
我正在开发一个(Perl)程序,该程序使用 Google Maps API 和 KML 文件从数据库中提取数据,从而在地图上创建点。我已经完成了这么多,但只有在我几乎一直放大到仅显示一个点的缩放级别后,这些点才会出现。
默认缩放仅显示我的小城市(3-5 英里),因此我认为所有点都能够显示。有谁知道如何让所有点显示在全市范围内,而不是仅在放大时才显示?
非常感谢任何帮助。谢谢!
编辑:添加了一个 JavaScript 标签,因为我已经看到很多使用 JS 的 Google 地图工作,并且考虑到这个问题确实不是特定于语言的,我认为其中一些开发人员可能能够提供一些见解。
I'm working on a (Perl) program that uses the Google Maps API and a KML file to pull data from a database that creates points on the map. I have that much done, but the points only appear after I zoom pretty much all the way in, to a zoom level where only one point is showing.
The default zoom only shows my small city (3-5 miles) so I thought all the points would be able to show. Does anybody know how to get all of the points to show up at city-wide level as opposed to only showing up when zoomed all the way in?
Any help is greatly appreciated. Thanks!
Edit: Added a JavaScript tag because I've seen a lot of work done with Google Maps using JS, and considering the problem really isn't language-specific, I figured some of those developers might be able to offer some insight.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试合并
标记,它是
的子级。您可以为从数据库获取的每个地标定义一次。或每个查询仅一次(由 minLat、maxLat、minLong、maxLong 定义)。在第一种情况下,LodPixels 是一个常量,而在后一种情况下,您必须将其计算为区域大小的函数。它确实可以在 Google 地球中使用,并且在地图中也可以使用。请此处查看它在 Earth API (JS) 中的工作情况Try to incorporate the
<Lod>
tag in your KML, which is child of a<Region>
. You can define this once per placemark you get from your DB. or only once per query (defined by minLat, maxLat, minLong, maxLong). In the first case the LodPixels is a constant whereas in the latter case you must calculate it as a function of the region size. It sure works in Google Earth and may work as well in Maps. Look here to see it work in Earth API (JS)