开发者

How would you create an overlay that doesn't pan using Google Maps API V3?

I need to place a layer over the map but under the markers and controls. The layer will obscure all but a small part of the map allowin开发者_开发问答g the user to highlight an area. The layer itself can't move with the map and can't block any controls, markers or events.

I've tried creating a control, but that is placed over the map and obscures other markers and events.

I've also tried creating a tile generator but I haven't found a way to position those statically.

Is it possible?


You can write a custom overlay (see: http://code.google.com/apis/maps/documentation/javascript/overlays.html#CustomOverlays) which implements OverlayView.

When the map is moved, the draw() method in your class will be called, and you can use this to work out what to draw to block off the parts of the map you don't want.

To put the layer under markers add it to the overlayLayer pane.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜