use of org.openlca.app.components.mapview.MapView in project olca-app by GreenDelta.
the class ResultMap method on.
static ResultMap on(Composite body, FormToolkit tk) {
Section section = UI.section(body, tk, M.Map);
UI.gridData(section, true, true);
Composite comp = UI.sectionClient(section, tk);
comp.setLayout(new FillLayout());
UI.gridData(comp, true, true);
ResultMap m = new ResultMap();
m.map = new MapView(comp);
m.map.addBaseLayers();
Actions.bind(section, Actions.create(M.Export, Icon.EXPORT.descriptor(), m::export));
return m;
}
use of org.openlca.app.components.mapview.MapView in project olca-app by GreenDelta.
the class MapSection method render.
void render(Composite body, FormToolkit tk) {
var section = UI.section(body, tk, "Geographic data");
UI.gridData(section, true, true).minimumHeight = 250;
var comp = UI.sectionClient(section, tk);
comp.setLayout(new FillLayout());
UI.gridData(comp, true, true);
// render the initial feature
map = new MapView(comp);
map.addBaseLayers();
feature = GeoJSON.unpack(location().geodata);
if (feature != null) {
updateMap();
}
// bind actions
if (!editor.isEditable())
return;
var edit = Actions.onEdit(() -> {
new GeoJSONDialog().open();
});
Actions.bind(section, edit);
}
Aggregations