Added link "Open Project" in the pop-up of WFS feature

This commit is contained in:
Francesco Mangiacrapa 2021-11-22 10:25:09 +01:00
parent 74e21e9962
commit 709270015b
6 changed files with 43 additions and 26 deletions

View File

@ -9,7 +9,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
#### Enhancements
- [#22370] Use a max-height for preview image shown in the pop-up
- [#22027] Integrated with MapBox Satellite
- Added link "Open Project" in the pop-up of WFS details
- Moved to gwt-ol3 v8.1.0-gwt2_9
## [v2.0.1] - 2021-11-10

View File

@ -11,7 +11,7 @@ The GeoPortal Data Viewer App is an application to access, discovery and navigat
* GWT v.2.9.0. [GWT](http://www.gwtproject.org) is licensed under [Apache License 2.0](http://www.gwtproject.org/terms.html)
* GWT-Bootstrap v.2.3.2.0. [GWT-Bootstrap](https://github.com/gwtbootstrap) is licensed under [[Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
* GWT-OpenLayers 3+ v.8.0.0-gwt2_9. [GWT-OL3](https://github.com/TDesjardins/gwt-ol)
* GWT-OpenLayers 3+ v.8.1.0-gwt2_9. [GWT-OL3](https://github.com/TDesjardins/gwt-ol)
* OpenLayers v.6.X. [OpenLayers](https://openlayers.org/) is licensed under [BSD 2-Clause "Simplified"](https://github.com/openlayers/openlayers/blob/main/LICENSE.md)
## Documentation

View File

@ -42,10 +42,6 @@ import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.core.client.ScriptInjector;
import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.dom.client.Style.Position;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.event.shared.HandlerManager;
@ -138,7 +134,7 @@ public class GeoportalDataViewer implements EntryPoint {
@Override
public void onFailure(Throwable caught) {
RootPanel.get(APP_DIV).remove(loaderApp);
Window.alert("Error occurred on instancing the GeoPortale Viewer. Please, contact the support");
Window.alert("Sorry, an error occurred on instancing the GeoPortale Viewer. Please, contact the support");
}
@Override

View File

@ -57,6 +57,7 @@ import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.EventListener;
import com.google.gwt.user.client.Random;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.FlexTable;
@ -558,6 +559,8 @@ public class LayerManager {
flowPanel.getElement().getStyle().setProperty("maxHeight", "600px");
scrollPanel.add(flowPanel);
List<Button> listOpenProject = new ArrayList<Button>();
final Button expandButton = new Button("Expand");
expandButton.setType(ButtonType.LINK);
expandButton.setIcon(IconType.EXPAND);
@ -578,6 +581,10 @@ public class LayerManager {
public void onBrowserEvent(Event event) {
if (Event.ONCLICK == event.getTypeInt()) {
expandButton.setVisible(false);
//hiding the Open Project in expand mode (Modal Window)
for (Button butt : listOpenProject) {
butt.setVisible(false);
}
flowPanel.getElement().getStyle().setProperty("maxHeight", "100%");
int width = Window.getClientWidth() * 75 / 100;
int height = Window.getClientHeight() * 70 / 100;
@ -624,6 +631,36 @@ public class LayerManager {
heading.setTitle(nomeConcessione);
heading.getElement().getStyle().setMarginBottom(10, Unit.PX);
flowPanel.add(heading);
Button buttOpenProject = new Button("Open Project");
final String buttId = "open-details-"+Random.nextInt();
buttOpenProject.getElement().setId(buttId);
buttOpenProject.setType(ButtonType.LINK);
if (buttOpenProject != null) {
flowPanel.add(buttOpenProject);
buttOpenProject.setType(ButtonType.LINK);
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
Element buttonElement = DOM.getElementById(buttId);
Event.sinkEvents(buttonElement, Event.ONCLICK);
Event.setEventListener(buttonElement, new EventListener() {
@Override
public void onBrowserEvent(Event event) {
if (Event.ONCLICK == event.getTypeInt()) {
applicationBus.fireEvent(new ShowDetailsEvent("concessione", lo.getSourceConcessione().getItemId(), nomeConcessione, null));
}
}
});
}
});
}
listOpenProject.add(buttOpenProject);
HTML subText = new HTML(
"<p style=\"color:#999; font-size:14px; margin:5px 0 5px 0;\">Layers and Properties</p>");
flowPanel.add(subText);
@ -687,6 +724,7 @@ public class LayerManager {
}
}
olMap.showPopup(scrollPanel.toString(), queryClick.getCenter());
}

View File

@ -56,7 +56,7 @@ public class GNABaseMapsResourceReader {
LOG.info("The query returned " + resources.size() + " ServiceEndpoint/s");
else
throw new RuntimeException("ServiceEndpoint not found. Searching for profile name: " + SE_PROFILE_NAME
+ " and category name: " + SE_CATEGORY_NAME + "in the scope: " + ScopeProvider.instance.get());
+ " and category name: " + SE_CATEGORY_NAME + ", in the scope: " + ScopeProvider.instance.get());
ServiceEndpoint se = resources.get(0);
Collection<AccessPoint> theAccessPoints = se.profile().accessPoints().asCollection();

View File

@ -674,25 +674,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
//Setting scope in the cuurent thread
SessionUtil.getCurrentContext(this.getThreadLocalRequest(), true);
listBL = SessionUtil.getGNABaseMaps(this.getThreadLocalRequest());
LOG.info("getListBaseLayers returning "+listBL.size() +" base maps");
//
// String attribution;
// BaseMapLayer baseLayer;
// // OSM
// attribution = "© <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a>";
// baseLayer = new BaseMapLayer("Open Street Map", "https://tile.openstreetmap.org/{z}/{x}/{y}.png", attribution,
// BaseMapLayer.OL_BASE_MAP.OSM);
// listBL.add(baseLayer);
// // MAPBOX
// attribution = "© <a href='https://www.mapbox.com/about/maps/'>Mapbox</a> © <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> <a href='https://www.mapbox.com/map-feedback/' target='_blank'>Improve this map</a>";
// baseLayer = new BaseMapLayer("MapBox Satellite",
// "https://{a-d}.tiles.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoiZDRzY2llbmNlIiwiYSI6ImNpcW1nZjE4MDAwMXNod25rdHJsemRoNTQifQ.YPNkNLb8EzjThpvJl1tg4w",
// attribution, BaseMapLayer.OL_BASE_MAP.MAPBOX);
//
// listBL.add(baseLayer);
return listBL;
}