Example #1
0
  private Marker createMarker(LatLng latLng, String label) {
    DivIcon icon = createIcon(label);

    Options markerOptions = new Options();
    markerOptions.setProperty("icon", icon);

    Marker marker = new Marker(latLng, markerOptions);
    return marker;
  }
Example #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);
  }
Example #3
0
 public void setShadowUrl(String icon) {
   markerOptions.setProperty("shadowUrl", icon);
   getJSObject().setProperty("marker_options", markerOptions.getJSObject());
 }
Example #4
0
 public void setEndIconUrl(String icon) {
   markerOptions.setProperty("endIconUrl", icon);
   getJSObject().setProperty("marker_options", markerOptions.getJSObject());
 }