如何在Google地图中更改KML和图块叠加层的层次? [英] How to change the layering of KML and Tile Overlays in Google Maps?

查看:435
本文介绍了如何在Google地图中更改KML和图块叠加层的层次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个项目中,我正在使用图块叠加层(可视)来显示空间,建筑物名称,可访问性和停车位以及KML多边形的渲染图 (功能),以允许用户点击各种建筑物或兴趣点以显示更多信息.我当前的问题在于这些要素的组织.

I'm working on a project where I am utilizing tile overlays (visual) to display a rendering of the space, building names, accessibility, and parking spaces as well as KML polygons (functionality) to allow the user to click on various buildings or points of interest to bring up further information. My current issue lies in the organization of these various elements.

目前,KML多边形显示在所有图块叠加层的上方,包括建筑物名称和停车位,我希望它们位于KML多边形的顶部,否则它们会被多边形部分遮盖.简而言之,这是当前的分层:

At the moment, the KML polygons are appearing above all the tile overlays, including building names and parking which I would prefer to be on top of the KML polygons as they are otherwise partly obscured by the polygons. In short, here is the current layering:

  • KML多边形
  • 建筑物名称​​(透明)
  • 可访问性(透明)
  • 停车(透明)
  • 空间渲染(不透明)
  • Google地图
  • KML Polygons
  • Building Names (Transparent)
  • Accessibility (Transparent)
  • Parking (Transparent)
  • Space Rendering (Opaque)
  • Google Maps

理想情况下,我希望KML多边形出现在这些图块叠加层中,即在空间渲染的正上方.因此,我希望获得这一层次:

Ideally, I would prefer to have the KML polygons appear within these tile overlays, namely right above the rendering of the space. Thus, I wish to obtain this layering:

  • 建筑物名称​​(透明)
  • 可访问性(透明)
  • 停车(透明)
  • KML多边形
  • 空间渲染(不透明)
  • Google地图
  • Building Names (Transparent)
  • Accessibility (Transparent)
  • Parking (Transparent)
  • KML Polygons
  • Space Rendering (Opaque)
  • Google Maps

反正有没有重新布置KML瓷砖覆盖层来实现这一目标?

Is there anyway to rearrange the KML the tile overlay layers to achieve this?

瓷砖叠加层:

map.overlayMapTypes.insertAt(0, renderMapType);
map.overlayMapTypes.insertAt(1, parkingMapType);
map.overlayMapTypes.insertAt(2, accessMapType);
map.overlayMapTypes.insertAt(3, nameMapType);

让我更清楚地解释地图.

Allow me to explain the map a bit more clearly.

当Google Maps位于地图"中时,将显示渲染,并且大多数KML多边形不可见,渲染中未表示的那些多边形仍然可见,因此用户仍然知道它们的存在.当Google Maps处于卫星"状态时,将不显示渲染,并且所有KML多边形均可见,并将其各自的元素覆盖在卫星图像上,从而使用户更易于查看.

When Google Maps is in "Map", the rendering is displayed and most of the KML polygons are invisible, those unrepresented on the render remaining visible so that the user is still aware of their presence. When Google Maps is in "Satellite", the rendering isn't displayed and all the KML polygons are visible and overlay their respective elements on the satellite image, making them easier for the user to see.

无论哪种情况,都可以使用辅助功能,停车位和名称叠加层,并且由于总是至少存在一些必须可见的KML多边形,我一直在寻找一种方法来对图层进行重新排序.

In either case, the accessibility, parking, and name overlays can be used and, as there is always at least some KML polygons which must be visible, I've resorted to looking for a way to reorder the layers.

推荐答案

要实际更改图层顺序,您需要使用自定义图块叠加层并将其放置在适当的窗格中.这是我编写的实现,可以免费使用.现在为其创建的大多数功能都存在于maps API中.

To actually change the layer ordering, you'll need to use a custom tile overlay and place it in the proper pane. This is the implementation I authored which is free to use. Most of the features it was created for now exist in the maps API.

http://search.missouristate.edu/map/mobile/examples/tileoverlay.htm

您可能需要调整在哪个窗格中绘制叠加层.这是适用的源代码行:

You'll probably need to adjust in which pane the overlay gets drawn. Here's the applicable source line:

this.getPanes().mapPane.appendChild(this.settings.div_);

这篇关于如何在Google地图中更改KML和图块叠加层的层次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆