ivory-google-map icon indicating copy to clipboard operation
ivory-google-map copied to clipboard

dragend event doesn't work. Entire map moves with the marker

Open enperezr opened this issue 6 years ago • 1 comments

Hello: I want to get the marker lat and log on dragend event but when I move the marker all the map moves with it. I want that only the marker moves when a drag it.

That is my code. Thanks

$map = new Map(); $map->setHtmlId('map'); $infoWindow = new InfoWindow(''); $infoWindow->setPosition(new Coordinate()); $map->getOverlayManager()->addInfoWindow($infoWindow); $marker = new Marker(new Coordinate()); $contentInfoWindow = 'example';

$event1 = new Event( $marker->getVariable(), 'dragend', 'function(){ '.$infoWindow->getVariable().'.setContent("Lat:'.$marker->getPosition()->getLatitude().' Log:'.$marker->getPosition()->getLongitude().'"); '.$infoWindow->getVariable().'.open(' .$map->getVariable().', this ); }', true );

$map->getOverlayManager()->addMarker($marker); $map->getEventManager()->addEvent($event1);

enperezr avatar Jul 05 '18 13:07 enperezr

same issue, but i can't get coordinate when clicked the maps

abdulazizzulfikar avatar Nov 13 '18 08:11 abdulazizzulfikar