Search in sources :

Example 1 with LeafletMap

use of org.activityinfo.ui.client.component.report.editor.map.LeafletMap in project activityinfo by bedatadriven.

the class MapReportView method addContent.

private void addContent() {
    if (map == null) {
        MapOptions options = new MapOptions();
        options.setZoom(element.getContent().getZoomLevel());
        options.setCenter(LeafletUtil.to(element.getContent().getCenter()));
        options.setProperty("zoomControl", false);
        options.setProperty("attributionControl", false);
        map = new LeafletMap(options);
        add(map);
        layout();
    }
    if (map.isRendered()) {
        syncContent();
    } else {
        map.addListener(Events.Render, new Listener<BaseEvent>() {

            @Override
            public void handleEvent(BaseEvent be) {
                syncContent();
            }
        });
    }
}
Also used : LeafletMap(org.activityinfo.ui.client.component.report.editor.map.LeafletMap) MapOptions(org.discotools.gwt.leaflet.client.map.MapOptions) BaseEvent(com.extjs.gxt.ui.client.event.BaseEvent)

Aggregations

BaseEvent (com.extjs.gxt.ui.client.event.BaseEvent)1 LeafletMap (org.activityinfo.ui.client.component.report.editor.map.LeafletMap)1 MapOptions (org.discotools.gwt.leaflet.client.map.MapOptions)1