Hi,

I have a .net application which is using gmaps api v3. I'm new to maps api 
and I have never programmed this before so please be patient. 
Here is the snippet from the code:

-----------------------------------------------------------------------------
    var map;
    function initialize(lat,lng) 
    {
        var myLatlng = new google.maps.LatLng(lat,lng);
        var myOptions = {
            zoom: 15,
            center: myLatlng,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        }
        map = new google.maps.Map(document.getElementById("map_canvas"), 
myOptions);

        google.maps.event.addListener(map, 'zoom_changed', function () {
            setTimeout(moveToDarwin, 3000);
        });

        var marker = new google.maps.Marker
        ({
            position: myLatlng,
            map: map,
            title: "Hello World!"
        });

        google.maps.event.addListener(marker, 'click', function () {
            map.setZoom(8);
        
        });
 }
     
 function moveToDarwin(lat, lng) {
        var darwin = new google.maps.LatLng(lat,lng);
        map.setCenter(darwin);
    };
---------------------------------------
The lat and lng I defined in the code behind and this code works fine, I can 
view the one marker. 
The problem occurs when I'm trying to put another marker after the first 
marker code:

var marker2 = new google.maps.Marker
        ({
            position: myLatlng2,
            map: map,
            title: "2nd marker!"
        });

This doesn't show anything on the page. I'm hard coding the lng and lat 
values for this 2nd marker so that It should be dipslayed and the value of 
these are not that far in terms of postcode so it's not completely out of 
bound but still it doesn't show. It doesn't even show the first marker. 
I know there are articles about loading markers using For loop and xml file 
and database but I just want to check this. 
Thanks in advance.

Cheers

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-maps-js-api-v3/-/mX6pX82kxb0J.
To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to