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();
}
});
}
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);
}
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);
}
});
}
Aggregations