private void createNewLocationMarker() { DivIcon icon = createIcon(""); Options markerOptions = new Options(); markerOptions.setProperty("icon", icon); markerOptions.setProperty("draggable", true); newLocationMarker = new Marker(newLatLng(newLocationPresenter.getLatLng()), markerOptions); EventHandlerManager.addEventHandler( newLocationMarker, org.discotools.gwt.leaflet.client.events.handler.EventHandler.Events.dragend, new EventHandler<Event>() { @Override public void handle(Event event) { newLocationPresenter.setLatLng( new AiLatLng( newLocationMarker.getLatLng().lat(), newLocationMarker.getLatLng().lng())); } }); map.addLayer(newLocationMarker); }
private void onNewLocationPosChanged() { if (newLocationMarker != null) { Log.debug("New marker pos: " + newLocationPresenter.getLatLng()); newLocationMarker.setLatLng(newLatLng(newLocationPresenter.getLatLng())); } }