ivory-google-map
ivory-google-map copied to clipboard
dragend event doesn't work. Entire map moves with the marker
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);
same issue, but i can't get coordinate when clicked the maps