Пример #1
0
  private void bindClickEvent(final LocationDTO location, Marker marker) {
    EventHandlerManager.addEventHandler(
        marker,
        org.discotools.gwt.leaflet.client.events.handler.EventHandler.Events.click,
        new EventHandler<MouseEvent>() {

          @Override
          public void handle(MouseEvent event) {
            searchPresenter.select(this, location);
          }
        });
  }
Пример #2
0
  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);
  }