Google Map V3 .png groundoverlay opacity

不羁的心 提交于 2019-11-29 07:44:52

Problem solved!

After declaring the var MyOptions, add

 var overlayOpts = {
      opacity:0.3
  }

Then call the variable in the .GroundOverlay call, directly after calling ImageBounds

i.e.

var oldmap = new google.maps.GroundOverlay(
"http://www.earthstation.mobi/cloakpS19E031.png",imageBounds, overlayOpts);
oldmap.setMap(map);

This same call is then used in each .groundoverlay call, assuming you want the same opacity setting for each overlay. If not, decalre another var and call that.

Finished product can be seen http://www.eartshtation.mobi/coverage.htm - In Firefox, Ctrl U will show you the source code.

Hope this helps somebody avoid the 3 days I spent searching for this solution!

this solved the same problem in my case - http://www.usnaviguide.com/v3maps/ProjectedOverlayTest.htm

With the library (http://www.usnaviguide.com/v3maps/js/ProjectedOverlay.js) inside the code you can easily change transparency by overlay.setOpacity()

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!