Closed redsilver closed 2 years ago
Hello. It's not clear if this issue is a question or a feature request. At the moment the addon does not implement a drag listener. I think that what you're trying to achieve can be done with something similar to this:
googlemap.setDraggable(true);
googlemap.getElement().setProperty("dragEvents", true);
googlemap.getElement().addEventListener("google-map-dragend", event -> {
googlemap.addMarker( "newMarker", googlemap.getCenter(), true, Markers.BLUE);
});
If you need to add the markers in a position that is different to the center of the map then I think you you need to use addClickListener that is already present in the components API.
I'm closing this ticket as there was no answer. Please feel free to comment/re-open if still valid.
I have to add markers programmatically when the users drag the map. Is possible to implement the drag listener of the map to achieve this? Thank you!