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:

  1. you can create markers , add them map @ later time e.g. after clicking button using setmap()
  2. you can have multiple maps on 1 page. can selectively add markers 1 of them using setmap()
  3. you can remove markers selectively map using setmap(null)

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -