Search in sources :

Example 1 with EPSG3857

use of org.discotools.gwt.leaflet.client.crs.epsg.EPSG3857 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());
}
Also used : EPSG3857(org.discotools.gwt.leaflet.client.crs.epsg.EPSG3857) LeafletReportOverlays(org.activityinfo.ui.client.component.report.editor.map.symbols.LeafletReportOverlays) MapOptions(org.discotools.gwt.leaflet.client.map.MapOptions) EventHandler(org.discotools.gwt.leaflet.client.events.handler.EventHandler) LeafletMarkerDrilldownEventHandler(org.activityinfo.ui.client.component.report.editor.map.symbols.LeafletMarkerDrilldownEventHandler) Event(org.discotools.gwt.leaflet.client.events.Event) AiLatLng(org.activityinfo.model.type.geo.AiLatLng) LatLng(org.discotools.gwt.leaflet.client.types.LatLng)

Example 2 with EPSG3857

use of org.discotools.gwt.leaflet.client.crs.epsg.EPSG3857 in project activityinfo by bedatadriven.

the class LocationMap method afterRender.

@Override
protected void afterRender() {
    super.afterRender();
    Extents countryBounds = searchPresenter.getCountryBounds();
    MapOptions mapOptions = new MapOptions();
    mapOptions.setCenter(new LatLng(countryBounds.getCenterY(), countryBounds.getCenterX()));
    mapOptions.setZoom(6);
    mapOptions.setProperty("crs", new EPSG3857());
    TileLayer baseLayer = new TileLayer(MapboxLayers.MAPBOX_STREETS, new Options());
    markerLayer = new LayerGroup(new ILayer[0]);
    map = new Map(getElement().getElementsByTagName("div").getItem(0), mapOptions);
    map.addLayer(baseLayer);
    map.addLayer(markerLayer);
    bindEvents();
}
Also used : EPSG3857(org.discotools.gwt.leaflet.client.crs.epsg.EPSG3857) MapOptions(org.discotools.gwt.leaflet.client.map.MapOptions) Options(org.discotools.gwt.leaflet.client.Options) TileLayer(org.discotools.gwt.leaflet.client.layers.raster.TileLayer) MapOptions(org.discotools.gwt.leaflet.client.map.MapOptions) ILayer(org.discotools.gwt.leaflet.client.layers.ILayer) AiLatLng(org.activityinfo.model.type.geo.AiLatLng) LayerGroup(org.discotools.gwt.leaflet.client.layers.others.LayerGroup) Extents(org.activityinfo.model.type.geo.Extents) Map(org.discotools.gwt.leaflet.client.map.Map)

Aggregations

AiLatLng (org.activityinfo.model.type.geo.AiLatLng)2 EPSG3857 (org.discotools.gwt.leaflet.client.crs.epsg.EPSG3857)2 MapOptions (org.discotools.gwt.leaflet.client.map.MapOptions)2 Extents (org.activityinfo.model.type.geo.Extents)1 LeafletMarkerDrilldownEventHandler (org.activityinfo.ui.client.component.report.editor.map.symbols.LeafletMarkerDrilldownEventHandler)1 LeafletReportOverlays (org.activityinfo.ui.client.component.report.editor.map.symbols.LeafletReportOverlays)1 Options (org.discotools.gwt.leaflet.client.Options)1 Event (org.discotools.gwt.leaflet.client.events.Event)1 EventHandler (org.discotools.gwt.leaflet.client.events.handler.EventHandler)1 ILayer (org.discotools.gwt.leaflet.client.layers.ILayer)1 LayerGroup (org.discotools.gwt.leaflet.client.layers.others.LayerGroup)1 TileLayer (org.discotools.gwt.leaflet.client.layers.raster.TileLayer)1 Map (org.discotools.gwt.leaflet.client.map.Map)1 LatLng (org.discotools.gwt.leaflet.client.types.LatLng)1