Hi,

I have created a simple html page to use google map.html file i am
using to use map is.

<html>
<head>
<script lang="javascript" src="http://maps.google.com/maps/api/js?
sensor=false">
</script>
        <script lang="javascript">
                    function initialize() {

                        lat = 0
                        long = 0;

                        var latlng = new google.maps.LatLng(lat,long);
                        var myOptions = {
                              zoom: 8,
                              center: latlng,
                              mapTypeId: google.maps.MapTypeId.ROADMAP
                            };

                       alert(document.getElementById("map"));

                        var map = new
google.maps.Map(document.getElementById("map"),myOptions);

                        marker = new google.maps.Marker({
                                map:map,
                                draggable:true,
                                animation: google.maps.Animation.DROP,
                                position: latlng
                              });

                        map.setCenter(latlng, 8);
                    }
                    google.setOnLoadCallback(initialize);
        </script>
</head>
<body >

 <div id="map" style="width:90%; height:100%;"></div>

</body>
</html>

When i open this page i am getting following error on javascirpt
console and no map on page
"Uncaught TypeError: Object #<an Object> has no method
'setOnLoadCallback'
(anonymous function)"

if i use body onload method to call initialize method map is rendered
properly but not using google.setOnLoadCallback(initialize);


can anyone please help me if i missed anything in this.

Thanks
Ankur

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to