I'm creating a simple map using this code:

<script src="http://maps.google.com/maps?
file=api&amp;v=2&amp;key=GOOGLEMAPSKEY" type="text/javascript"></
script>

<script type="text/javascript">

// Global variable
var map;
var marker;

/**
 * hoverControls method to hide/show GControls by
'mouseout'/'mouseover'
 */

GMap2.prototype.hoverControls = function(opt_noCloseIw){

        var theMap = this;
        theMap.hideControls();
        GEvent.addListener(theMap, "mouseover", function(){
                theMap.showControls();
        });
        GEvent.addListener(theMap, "mouseout", function(){
                theMap.hideControls();
        });
        //theMap.libraryCard = 19162;
}


function mypage_createMarker(point) {
        var marker_ = new GMarker(point);
        return marker_;
}


function loadMap(){

        if (GBrowserIsCompatible()) {

                /* Maps settings */
                map = new GMap2(document.getElementById("map"));
                map.addControl(new GLargeMapControl());
                map.addControl(new GMapTypeControl());

                // add marker
                var geoLat = <%= geoLat %>;
                var geoLong = <%= geoLong %>;
                var point  = new GLatLng(geoLat,geoLong);
                marker = mypage_createMarker(point);
                map.addOverlay(marker);

                // map center
                map.setCenter(point, 10,G_NORMAL_MAP);
                map.hoverControls();
        }
        else{
                alert("Warning");
        }
}

// Define default operations
window.onload = loadMap;
window.onunload = GUnload;
</script>

and i use it in liferay portlet enviroment. I build this work in local
platform and so i can't to create an example page in internet.
If i use normal GMarker function to create marker in the load function
i have no error, instead if i use mypage_createMarker i have error
"this.Q is null in main.js row 776".
I tryed clean browser cache, use 2.x api version but there is no
change.
Can someone help me?
Thanks in advance
--~--~---------~--~----~------------~-------~--~----~
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