Friday, 15 February 2013

Google Maps - create a map using a class not an ID? -



Google Maps - create a map using a class not an ID? -

i have google map, , have 3 tabs. ideally utilize same map in 3 tabs, seems can create map using id:

map = new google.maps.map(document.getelementbyid('map_canvas'), mapoptions);

if case, have create 3 separate maps 3 separate id's? can create 3 google maps using 'class' , repurpose same map?

you can utilize jquery's object create new map

var mapclass = $('.map_canvas'); , var map = new google.maps.map(mapclass[0],mapoptions);

please view jsfiddle , allow me know http://jsfiddle.net/davidchase03/fdfmz/

google-maps

No comments:

Post a Comment