Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML Canvas As Overlayview In Google Maps

Are there any examples of a google map that has one big canvas as an overlayview. I'm having a hard time positioning the canvas whenever the map zoom or pans.

like image 503
dpham Avatar asked May 05 '11 22:05

dpham


2 Answers

Check out the CanvasLayer library which basically takes all of this into account for you as a reference implementation.

like image 96
Joseph Lust Avatar answered Nov 05 '22 06:11

Joseph Lust


Try the map bounds method, get the northeast and southwest view of current viewable map and use a js function to modify the overlay on each zoom to change the position dynamically.

mapBound = map.getBounds();
northEndOfMap =mapBound.getNorthEast(); 

and to get map zoom map.getZoom();
Refer: http://code.google.com/apis/maps/documentation/javascript/reference.html#Map

like image 30
Joe Avatar answered Nov 05 '22 07:11

Joe