Guys.. newbie here. Trying to set the default map to Australia with an 
appropriate zoom. Code came with the example. Eventually I will swap 
address for postcode. When I did this I ended up in Germany with an 
australian postode.

any help is appreciated.


-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.


<script type="text/javascript" 
src="http://maps.google.com/maps/api/js?sensor=false";></script>
<div id="map" style="width: 700px; height: 400px"></div>
<script type="text/javascript">

var latlng = new google.maps.LatLng(40.756, -73.986);

var options = {
        center : latlng,
        zoom : 1,
        mapTypeId : google.maps.MapTypeId.ROADMAP
};

// Creating the map
var map = new google.maps.Map(document.getElementById('map'), options);

var geocoder = new google.maps.Geocoder();
var infowindow;

function displayLocation(a) {
        displayMap(a, 0);
}

function displayInfo(a) {
        displayMap(a, 1);
}

function displayMap(address, displayInfo) {
        geocoder.geocode( {'address' : address}, function(results, status) {
                if (status == google.maps.GeocoderStatus.OK) {
                        map.setCenter(results[0].geometry.location);
                        var marker = new google.maps.Marker( {
                                map : map,
                                position : results[0].geometry.location
                        });

                        if (!infowindow) {
                                infowindow = new google.maps.InfoWindow();
                        }

                        infowindow.setContent(address);

                        if (displayInfo == 1) {
                                infowindow.open(map, marker);
                        }

                } else {
                        // alert("Incorrect adress: " +status+address);
                }
        });
}
</script>

Reply via email to