kml边界以外的阴影区域 [英] shading area outside of kml boundary

查看:126
本文介绍了kml边界以外的阴影区域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人看到过一种方式来遮蔽/着色谷歌地图的区域,而这些区域是由KML文件创建的边界/形状之外的?

一个示例用法只有边界/形状内的区域是交互式的(点击监听器等),边界外的阴影区域将忽略除基本地图功能之外的所有动作,如来回移动地图。

解决方案

这是我一直在努力的一个选项(并不完全可行,但概念可能解决您的问题) p>


  1. 创建感兴趣区域的KML文件(在美国示例中)
  2. 反转添加全球的外部边界

  3. 或者使用额外的KmlLayer将其显示在您的地图上,或将其导入FusionTable中(如示例所示)
  4. 确保在倒置图层上禁用infoWindows

示例
- 不适用于弗吉尼亚州或阿拉斯加州
- 夏威夷有问题。
- 将最小缩放比例限制为5。


Has anyone seen a way to shade/color areas of a google map that are outside of a boundary/shape created by a KML file?

An example usage would be that only the area inside the boundary/shape would be interactive (click listeners etc.), and the shaded area outside of the boundary would ignore all actions aside from the basic map functionality, like moving the map back and forth.

解决方案

Here is an option I have been working on (doesn't quite completely work, but the concept may address your question):

  1. Create a KML file of the area of interest (in the example US states)
  2. Invert it by adding an outer boundary of the whole world
  3. Either display it on your map using an additional KmlLayer or import it into FusionTable (like the example)
  4. Be sure to suppress infoWindows on the "inverted" layer

Example - Doesn't work for Virginia or Alaska - Hawaii is problematic. - Limits the minimum zoom to 5.

这篇关于kml边界以外的阴影区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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