posted 11 years ago
i am new with google maps API and i try to get a map by defining cordinates.
but i allways get the same map
function initialize() {
directionsDisplay = new google.maps.DirectionsRenderer();
geocoder = new google.maps.Geocoder();
var address = "HaYarkon 100 TelAviv Israel";
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK)
{
TelAviv = new google.maps.LatLng(results[0].geometry.location.lat(),results[0].geometry.location.lng());
}
});
var myOptions = {
zoom:7,
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: TelAviv
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
directionsDisplay.setMap(map);
}