how to insert zoom , sattelite image and trafic opption on google map in php and javascript?

i have to display google map in my php code.

for that i have used the following code,

Read More

function addAddressToMap(response) {

     map.clearOverlays();
     if (!response || response.Status.code != 200) {
       alert("Sorry, we were unable to geocode that address");
     } else {
       place = response.Placemark[0];
       point = new GLatLng(place.Point.coordinates[1],
                           place.Point.coordinates[0]);
     map.setCenter(new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]), 13);
     marker = new GMarker(point);
     map.addOverlay(marker);
 marker.openInfoWindowHtml('<b>City:</b> ' + document.getElementById('city').value);
     }




    } 

and this code runs perfectly and giving me map also and writenow i m unable to show that output.

but i want to place zoom, sattelite image and traffic option on that map just like google maps.

any help?

Related posts

Leave a Reply

1 comment

  1. Found this in Google API’s documentation

    function initialize() {
          if (GBrowserIsCompatible()) {
            var map = new GMap2(document.getElementById("map_canvas"))
            map.setCenter(new GLatLng(37.4419, -122.1419), 13);
            map.addControl(new GSmallMapControl());
            map.addControl(new GMapTypeControl());
          }
        }
    

    I think you need to call the addControl method on yours also.

    see http://code.google.com/apis/maps/documentation/javascript/v2/examples/control-simple.html