Google maps setMap() and map options -
i new google maps api v3. in google maps official tutorial, of sample code using
new google.maps.marker({ map: map //map option });
or
new google.maps.marker({ //some options here }).setmap(map);
what difference between each other?
off top of head:
- you can create markers , add them map @ later time e.g. after clicking button using
setmap()
- you can have multiple maps on 1 page. can selectively add markers 1 of them using
setmap()
- you can remove markers selectively map using
setmap(null)
Comments
Post a Comment