use of org.discotools.gwt.leaflet.client.events.handler.EventHandler in project activityinfo by bedatadriven.
the class MapEditorMapView method createMap.
private void createMap() {
MapOptions mapOptions = new MapOptions();
mapOptions.setCenter(new LatLng(content.getExtents().getCenterY(), content.getExtents().getCenterX()));
mapOptions.setZoom(6);
mapOptions.setProperty("crs", new EPSG3857());
map = new LeafletMap(mapOptions);
add(map);
layout();
EventHandlerManager.addEventHandler(map.getMap(), Events.moveend, new EventHandler() {
@Override
public void handle(Event event) {
updateModelFromMap();
}
});
EventHandlerManager.addEventHandler(map.getMap(), Events.zoomend, new EventHandler() {
@Override
public void handle(Event event) {
updateModelFromMap();
}
});
overlays = new LeafletReportOverlays(map.getMap());
}
use of org.discotools.gwt.leaflet.client.events.handler.EventHandler in project activityinfo by bedatadriven.
the class LeafletMarkerFactory method create.
public static Marker create(MapMarker mapMarker, final EventHandler... markerEventHandlers) {
final Marker marker;
if (mapMarker instanceof IconMapMarker) {
marker = createIconMapMarker((IconMapMarker) mapMarker);
} else if (mapMarker instanceof PieMapMarker) {
marker = createPieMapMarker((PieMapMarker) mapMarker);
} else if (mapMarker instanceof BubbleMapMarker) {
marker = createBubbleMapMarker((BubbleMapMarker) mapMarker);
} else {
final Options options = new Options();
setModel(options.getJSObject(), mapMarker);
marker = new Marker(toLatLng(mapMarker), options);
}
if (markerEventHandlers != null) {
for (EventHandler handler : markerEventHandlers) {
EventHandlerManager.addEventHandler(marker, EventHandler.Events.click, handler);
}
}
return marker;
}
Aggregations