Friday, August 9, 2013

Google maps visual refresh

















There is a simple js to enable visual refresh in google maps.


google.maps.visualRefresh = true; // enabling the visual refresh globaly

var map;
function initialize() {
  var mapOptions = {
    zoom: 8,
    center: new google.maps.LatLng(-34.397, 150.644), // center point
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  map = new google.maps.Map(document.getElementById('map-canvas'),
      mapOptions); // load the map
}


google.maps.event.addDomListener(window, 'load', initialize);

Visual refresh add new look and feel of google maps to your own web sites googl map.


Wednesday, August 7, 2013

How to set bounds to a Google maps(Zooming option)

var bounds = new google.maps.LatLngBounds();
bounds.extend(positionOfPlace);
 map.fitBounds(bounds);

You can adjust zoom level according to the distribution of pin points. Make a variable bounds and initialize it. PositionOfPlace refers to the lat long of the center of the prefered map.
Simpply then set bounds using fitBounds.

Make sure you add this coding to head section of your web page.