use of org.discotools.gwt.leaflet.client.events.Event 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.Event in project activityinfo by bedatadriven.
the class LocationMap method createNewLocationMarker.
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);
}
Aggregations