Using the cdnjs.cloudflare.com/ajax/libs/nanogallery2
This commit is contained in:
parent
260aca4036
commit
3939cddf73
|
@ -88,109 +88,109 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
mainPanel = new GeonaDataViewMainPanel(applicationBus, getClientHeight());
|
mainPanel = new GeonaDataViewMainPanel(applicationBus, getClientHeight());
|
||||||
|
|
||||||
RootPanel.get(APP_DIV).add(mainPanel);
|
RootPanel.get(APP_DIV).add(mainPanel);
|
||||||
|
|
||||||
Timer t = new Timer() {
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void execute() {
|
||||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
|
||||||
|
|
||||||
@Override
|
olMapMng = new OLMapManager(mainPanel.getMapPanel().getElement().getId(),
|
||||||
public void execute() {
|
layerManager.getLayerManagerBus());
|
||||||
|
layerManager.setOlMap(olMapMng.getOLOSMMap());
|
||||||
olMapMng = new OLMapManager(mainPanel.getMapPanel().getElement().getId(),layerManager.getLayerManagerBus());
|
mainPanel.setMap(olMapMng.getOLOSMMap());
|
||||||
layerManager.setOlMap(olMapMng.getOLOSMMap());
|
updateSize();
|
||||||
mainPanel.setMap(olMapMng.getOLOSMMap());
|
ScriptInjector.fromUrl("//cdnjs.cloudflare.com/ajax/libs/nanogallery2/3.0.5/jquery.nanogallery2.min.js")
|
||||||
updateSize();
|
|
||||||
ScriptInjector.fromUrl("//cdn.jsdelivr.net/npm/nanogallery2@3/dist/jquery.nanogallery2.min.js")
|
|
||||||
.setWindow(ScriptInjector.TOP_WINDOW).inject();
|
.setWindow(ScriptInjector.TOP_WINDOW).inject();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Window.addResizeHandler(new ResizeHandler() {
|
Window.addResizeHandler(new ResizeHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void onResize(ResizeEvent event) {
|
public void onResize(ResizeEvent event) {
|
||||||
updateSize();
|
updateSize();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
paramWmsRequest = Window.Location.getParameter(GeoportalDataViewerConstants.GET_WMS_PARAMETER);
|
paramWmsRequest = Window.Location.getParameter(GeoportalDataViewerConstants.GET_WMS_PARAMETER);
|
||||||
paramGeonaItemType = Window.Location.getParameter(GeoportalDataViewerConstants.GET_GEONA_ITEM_TYPE);
|
paramGeonaItemType = Window.Location.getParameter(GeoportalDataViewerConstants.GET_GEONA_ITEM_TYPE);
|
||||||
//paramUUID = Window.Location.getParameter(GeoportalDataViewerConstants.GET_UUID_PARAMETER);
|
// paramUUID =
|
||||||
paramGeonaItemID = Window.Location.getParameter(GeoportalDataViewerConstants.GET_GEONA_ITEM_ID);
|
// Window.Location.getParameter(GeoportalDataViewerConstants.GET_UUID_PARAMETER);
|
||||||
paramLayerTitle = Window.Location.getParameter(GeoportalDataViewerConstants.GET_LAYER_TITLE);
|
paramGeonaItemID = Window.Location.getParameter(GeoportalDataViewerConstants.GET_GEONA_ITEM_ID);
|
||||||
GWT.log(GeoportalDataViewerConstants.GET_WMS_PARAMETER + " = " + paramWmsRequest);
|
paramLayerTitle = Window.Location.getParameter(GeoportalDataViewerConstants.GET_LAYER_TITLE);
|
||||||
GWT.log(GeoportalDataViewerConstants.GET_GEONA_ITEM_TYPE + " = " + paramGeonaItemType);
|
GWT.log(GeoportalDataViewerConstants.GET_WMS_PARAMETER + " = " + paramWmsRequest);
|
||||||
GWT.log(GeoportalDataViewerConstants.GET_GEONA_ITEM_ID + " = " + paramGeonaItemID);
|
GWT.log(GeoportalDataViewerConstants.GET_GEONA_ITEM_TYPE + " = " + paramGeonaItemType);
|
||||||
//GWT.log(GeoportalDataViewerConstants.GET_UUID_PARAMETER + " = " + paramUUID);
|
GWT.log(GeoportalDataViewerConstants.GET_GEONA_ITEM_ID + " = " + paramGeonaItemID);
|
||||||
GWT.log(GeoportalDataViewerConstants.GET_LAYER_TITLE + " = " + paramLayerTitle);
|
// GWT.log(GeoportalDataViewerConstants.GET_UUID_PARAMETER + " = " + paramUUID);
|
||||||
|
GWT.log(GeoportalDataViewerConstants.GET_LAYER_TITLE + " = " + paramLayerTitle);
|
||||||
//VALIDATING THE LONG FORMAT FOR GID
|
|
||||||
try {
|
|
||||||
if(paramGeonaItemID!=null)
|
|
||||||
Long.parseLong(paramGeonaItemID);
|
|
||||||
}catch (Exception e) {
|
|
||||||
Window.alert("Bad format for parameter "+GeoportalDataViewerConstants.GET_GEONA_ITEM_ID+". It must be a Long");
|
|
||||||
paramGeonaItemID = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
|
||||||
|
|
||||||
@Override
|
// VALIDATING THE LONG FORMAT FOR GID
|
||||||
public void execute() {
|
try {
|
||||||
GeoportalDataViewerServiceAsync.Util.getInstance().getGeoNaDataViewProfile(new AsyncCallback<GeoNaDataViewerProfile>() {
|
if (paramGeonaItemID != null)
|
||||||
|
Long.parseLong(paramGeonaItemID);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Window.alert("Bad format for parameter " + GeoportalDataViewerConstants.GET_GEONA_ITEM_ID
|
||||||
|
+ ". It must be a Long");
|
||||||
|
paramGeonaItemID = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute() {
|
||||||
|
GeoportalDataViewerServiceAsync.Util.getInstance()
|
||||||
|
.getGeoNaDataViewProfile(new AsyncCallback<GeoNaDataViewerProfile>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
Window.alert(caught.getMessage());
|
Window.alert(caught.getMessage());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(GeoNaDataViewerProfile profile) {
|
public void onSuccess(GeoNaDataViewerProfile profile) {
|
||||||
geonaDataViewerProfile = profile;
|
geonaDataViewerProfile = profile;
|
||||||
GWT.log("Profile: "+geonaDataViewerProfile);
|
GWT.log("Profile: " + geonaDataViewerProfile);
|
||||||
Iterator<String> it;
|
Iterator<String> it;
|
||||||
String theItemType = paramGeonaItemType;
|
String theItemType = paramGeonaItemType;
|
||||||
if(theItemType==null) {
|
if (theItemType == null) {
|
||||||
it = geonaDataViewerProfile.getMapLayers().keySet().iterator();
|
it = geonaDataViewerProfile.getMapLayers().keySet().iterator();
|
||||||
it.hasNext();
|
it.hasNext();
|
||||||
theItemType= it.next();
|
theItemType = it.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
LayerItem layerItem = geonaDataViewerProfile.getMapLayers().get(theItemType);
|
LayerItem layerItem = geonaDataViewerProfile.getMapLayers().get(theItemType);
|
||||||
|
|
||||||
if(layerItem==null) {
|
if (layerItem == null) {
|
||||||
Window.alert("Not detected any layer with type: "+theItemType);
|
Window.alert("Not detected any layer with type: " + theItemType);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GWT.log("The layerItem is: "+layerItem);
|
GWT.log("The layerItem is: " + layerItem);
|
||||||
layerManager.addLayer(theItemType, null, null, layerItem.getWmsLink(), false, false, null, true);
|
layerManager.addLayer(theItemType, null, null, layerItem.getWmsLink(), false, false,
|
||||||
|
null, true);
|
||||||
if(paramGeonaItemID!=null) {
|
|
||||||
if(paramGeonaItemType==null) {
|
if (paramGeonaItemID != null) {
|
||||||
Window.alert("Missing parameter "+GeoportalDataViewerConstants.GET_GEONA_ITEM_TYPE +" (GeoNa Data Type) where to search the item id: "+paramGeonaItemID);
|
if (paramGeonaItemType == null) {
|
||||||
|
Window.alert(
|
||||||
|
"Missing parameter " + GeoportalDataViewerConstants.GET_GEONA_ITEM_TYPE
|
||||||
|
+ " (GeoNa Data Type) where to search the item id: "
|
||||||
|
+ paramGeonaItemID);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GeoNaItemRef gir = new GeoNaItemRef(new Long(paramGeonaItemID), paramGeonaItemType);
|
GeoNaItemRef gir = new GeoNaItemRef(new Long(paramGeonaItemID), paramGeonaItemType);
|
||||||
applicationBus.fireEvent(new ShowDetailsEvent(gir, null, null));
|
applicationBus.fireEvent(new ShowDetailsEvent(gir, null, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
bindEvents();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
t.schedule(3000);
|
|
||||||
|
|
||||||
|
bindEvents();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update window size.
|
* Update window size.
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
type="text/javascript"></script>
|
type="text/javascript"></script>
|
||||||
|
|
||||||
<link
|
<link
|
||||||
href="https://cdn.jsdelivr.net/npm/nanogallery2@3/dist/css/nanogallery2.min.css"
|
href="//cdnjs.cloudflare.com/ajax/libs/nanogallery2/3.0.5/css/nanogallery2.min.css"
|
||||||
rel="stylesheet" type="text/css">
|
rel="stylesheet" type="text/css">
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<!-- Any title is fine -->
|
<!-- Any title is fine -->
|
||||||
|
|
|
@ -29,4 +29,8 @@
|
||||||
<script type="text/javascript"
|
<script type="text/javascript"
|
||||||
src="<%=request.getContextPath()%>/GeoportalDataViewer/GeoportalDataViewer.nocache.js"></script>
|
src="<%=request.getContextPath()%>/GeoportalDataViewer/GeoportalDataViewer.nocache.js"></script>
|
||||||
|
|
||||||
|
<link
|
||||||
|
href="cdnjs.cloudflare.com/ajax/libs/nanogallery2/3.0.5/css/nanogallery2.min.css"
|
||||||
|
rel="stylesheet" type="text/css">
|
||||||
|
|
||||||
<div id="geoportal-data-viewer"></div>
|
<div id="geoportal-data-viewer"></div>
|
Loading…
Reference in New Issue