Clip Google Maps JS API ImageMapType to a polygon

后端 未结 6 1687
梦毁少年i
梦毁少年i 2021-02-04 23:21

How can I clip a MapType in Google Maps to an arbitrary polygon. For example, if I have a custom ImageMapType that covers a large area (i.e. all the world), but I want to show i

6条回答
  •  走了就别回头了
    2021-02-04 23:51

    I see that you can't use normal masking strategies because you need to be able to see the lower layer. May I suggest SVG's more complete clipping suite? See here.

    The browser compatibility is good but not great, but you can absolutely accomplish what you're trying here (unless you need to pan/zoom the Map, then you're screwed until Maps implements such a thing).

提交回复
热议问题