Search in sources :

Example 1 with GetBaseMaps

use of org.activityinfo.shared.command.GetBaseMaps in project activityinfo by bedatadriven.

the class BaseMapDialog method loadBaseMaps.

private void loadBaseMaps() {
    listView.getStore().removeAll();
    listView.getStore().add(googleThumb(GoogleBaseMap.ROADMAP, I18N.CONSTANTS.googleRoadmap()));
    listView.getStore().add(googleThumb(GoogleBaseMap.SATELLITE, I18N.CONSTANTS.googleSatelliteMap()));
    listView.getStore().add(googleThumb(GoogleBaseMap.HYBRID, I18N.CONSTANTS.googleHybrid()));
    listView.getStore().add(googleThumb(GoogleBaseMap.TERRAIN, I18N.CONSTANTS.googleTerrainMap()));
    updateSelection();
    service.execute(new GetBaseMaps(), new MaskingAsyncMonitor(listView, I18N.CONSTANTS.loading()), new AsyncCallback<BaseMapResult>() {

        @Override
        public void onFailure(Throwable caught) {
            failLoadingBaseMaps();
        }

        @Override
        public void onSuccess(BaseMapResult result) {
            List<ModelData> thumbnails = new ArrayList<ModelData>();
            for (BaseMap baseMap : result.getBaseMaps()) {
                thumbnails.add(tileThumb(baseMap));
            }
            listView.getStore().add(thumbnails);
            updateSelection();
        }
    });
}
Also used : ModelData(com.extjs.gxt.ui.client.data.ModelData) BaseModelData(com.extjs.gxt.ui.client.data.BaseModelData) MaskingAsyncMonitor(org.activityinfo.client.dispatch.monitor.MaskingAsyncMonitor) BaseMapResult(org.activityinfo.shared.command.result.BaseMapResult) GetBaseMaps(org.activityinfo.shared.command.GetBaseMaps) ArrayList(java.util.ArrayList) List(java.util.List) TileBaseMap(org.activityinfo.shared.map.TileBaseMap) GoogleBaseMap(org.activityinfo.shared.map.GoogleBaseMap) BaseMap(org.activityinfo.shared.map.BaseMap)

Example 2 with GetBaseMaps

use of org.activityinfo.shared.command.GetBaseMaps in project activityinfo by bedatadriven.

the class MapGenerator method getBaseMap.

private BaseMap getBaseMap(String baseMapId) {
    BaseMapResult maps = dispatcher.execute(new GetBaseMaps());
    for (TileBaseMap map : maps.getBaseMaps()) {
        if (map.getId().equals(baseMapId)) {
            return map;
        }
    }
    LOGGER.log(Level.SEVERE, "Could not find base map id=" + baseMapId);
    return TileBaseMap.createNullMap(baseMapId);
}
Also used : BaseMapResult(org.activityinfo.shared.command.result.BaseMapResult) TileBaseMap(org.activityinfo.shared.map.TileBaseMap) GetBaseMaps(org.activityinfo.shared.command.GetBaseMaps)

Example 3 with GetBaseMaps

use of org.activityinfo.shared.command.GetBaseMaps in project activityinfo by bedatadriven.

the class BaseMapPanel method loadTileMapLabel.

private void loadTileMapLabel() {
    label.setText(I18N.CONSTANTS.loading());
    dispatcher.execute(new GetBaseMaps(), new AsyncCallback<BaseMapResult>() {

        @Override
        public void onFailure(Throwable caught) {
            label.setText(value);
        }

        @Override
        public void onSuccess(BaseMapResult result) {
            for (TileBaseMap baseMap : result.getBaseMaps()) {
                if (baseMap.getId().equals(value)) {
                    label.setText(baseMap.getName());
                    return;
                }
            }
            label.setText(value);
        }
    });
}
Also used : BaseMapResult(org.activityinfo.shared.command.result.BaseMapResult) TileBaseMap(org.activityinfo.shared.map.TileBaseMap) GetBaseMaps(org.activityinfo.shared.command.GetBaseMaps)

Aggregations

GetBaseMaps (org.activityinfo.shared.command.GetBaseMaps)3 BaseMapResult (org.activityinfo.shared.command.result.BaseMapResult)3 TileBaseMap (org.activityinfo.shared.map.TileBaseMap)3 BaseModelData (com.extjs.gxt.ui.client.data.BaseModelData)1 ModelData (com.extjs.gxt.ui.client.data.ModelData)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 MaskingAsyncMonitor (org.activityinfo.client.dispatch.monitor.MaskingAsyncMonitor)1 BaseMap (org.activityinfo.shared.map.BaseMap)1 GoogleBaseMap (org.activityinfo.shared.map.GoogleBaseMap)1