Tips for Upgrading Gmaps v2 to v3 more quickly

Viewed 11951

After upgrade my complete code i had here the most currents tips to upgrade your code. Add other if you like.

Use : new google.maps. in place of G...

  • GLatLngBounds() --> google.maps.LatLngBounds()
  • GlatLng --> google.maps.LatLng
  • GPoint --> google.maps.Point
  • Event.addListener --> google.maps.event.addListener
  • map.getInfoWindow().getPoint --> google.maps.getPosition()
  • markers[i].getPoint() --> markers[i].getPosition()
  • closeInfoWindow() --> map.InforWindow.Close();
  • map.getBoundsZoomLevel(bounds) --> map.fitBounds(bounds)
  • markers[i].setImage --> .setIcon
  • map.InfoWindow.close() --> create a function to close
  • find in maps for objects --> $('#id')[0] or $('#id').get(0) or document.getElementbyId

Happy coding.

0 Answers
Related