Hello
I'm making application where user can drag image and place it on map
and I met such problem.
I'm catching current_latlng using such code:
private var current_latlng :LatLng;
this.map.addEventListener(MapMouseEvent.MOUSE_MOVE,onRollover_map);
private function onRollover_map (event:MapMouseEvent):void {
trace(event.latLng.toString());
this.current_latlng=event.latLng;
}
It works fine and debugger shows me current LatLng, but when I'm
dragging Image over over map debugger shows me LatLng only when I move
Image quickly and when I'm moving Image pixel by pixel LatLng stops
refreshing.
But when I'm dragging a created marker over map refresh goes fine.
So, with this problem I can't position new marker on map correctly.
That is code for "drag and drop":
private function onDrag_icon (event:MouseEvent) : void {
var img:Image = event.currentTarget as Image;
var dragImg:Image = new Image();
dragImg.source = img.source;
var dsource:DragSource = new DragSource();
dsource.addData(img, 'img');
DragManager.doDrag(img, dsource , event, dragImg);
}
private function dragAccept (event:DragEvent):void
{
var dropTarget:Map = event.currentTarget as com.google.maps.Map;
DragManager.acceptDragDrop(dropTarget);
}
private function onDragEnd (event:DragEvent):void {
this.markerHouse.icon=this.cloneIcon(this.iconBMP);
this.map.addOverlay(new Marker (current_latlng, this.markerHouse));
}
PS: Sorry for my English.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API For Flash" 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-for-flash?hl=en
-~----------~----~----~----~------~----~------~--~---