PDA

View Full Version : add gmap



sedoyksa
3 Nov 2011, 4:46 PM
hi
i have code

GEvent.addListener(
cont.items.map.Gmap_panel_test.gmap,
'click',
function(e,xy){
var point = new GLatLng(xy.x, xy.y);
var marker = new GMarker(point, {draggable: true});
this.addOverlay(marker);
Ext.Msg.alert('You click at','lat: '+xy.x+',long:'+xy.y)
}
)

but i haven't marker after click. something wrong?its just alert

twaindev
4 Nov 2011, 5:31 AM
Looks like you're using an older Google Maps API? I advise you to use the latest version.

An example of adding a marker on mouse click using the latest API can be found here:

http://code.google.com/intl/nl-NL/apis/maps/documentation/javascript/events.html#EventArguments