in asp page

i can call "test" function only from "onclick"  event on the body of
the page but not from the body of the page. it happens that map object
seems not be null or not an object...

it worked before in the previous web server

someone can help me?

see the code below as example

<head>


    <script type="text/javascript" language="javascript">
    var map;
    var MRK;
    var Adriano = "vedi che va"

    function initialize() {
        if (GBrowserIsCompatible()) {
            map = new GMap2(document.getElementById("map_canvas"));
            map.setCenter(new GLatLng
(46.798333333333,12.8833333333333),07);
            map.setUIToDefault();
            map.setMapType(G_PHYSICAL_MAP);

        }
    }

    function test(){

        MRK = new GIcon();
        MRK.image = "/images/mrk.png";
        MRK.iconSize = new GSize(24, 24);
        MRK.iconAnchor = new GPoint(6, 6);
        MRK.infoWindowAnchor = new GPoint(5, 5);
        var LL = new GLatLng(46.798333333333, 12.8833333333333);
        var marker = new GMarker(LL, { title: "123", icon: MRK });


        var overlay = map.addOverlay(marker);
        alert("done");
    }



    </script>
</head>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to