Added Application Loader
This commit is contained in:
parent
846a303ff2
commit
74e21e9962
|
@ -32,6 +32,7 @@ import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
|
import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap;
|
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.ui.GeonaDataViewMainPanel;
|
import org.gcube.portlets.user.geoportaldataviewer.client.ui.GeonaDataViewMainPanel;
|
||||||
|
import org.gcube.portlets.user.geoportaldataviewer.client.util.LoaderIcon;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.util.URLUtil;
|
import org.gcube.portlets.user.geoportaldataviewer.client.util.URLUtil;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
|
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery;
|
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery;
|
||||||
|
@ -41,6 +42,10 @@ import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.core.client.Scheduler;
|
import com.google.gwt.core.client.Scheduler;
|
||||||
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
||||||
import com.google.gwt.core.client.ScriptInjector;
|
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.ResizeEvent;
|
||||||
import com.google.gwt.event.logical.shared.ResizeHandler;
|
import com.google.gwt.event.logical.shared.ResizeHandler;
|
||||||
import com.google.gwt.event.shared.HandlerManager;
|
import com.google.gwt.event.shared.HandlerManager;
|
||||||
|
@ -94,7 +99,7 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
|
|
||||||
int attempt = 0;
|
int attempt = 0;
|
||||||
|
|
||||||
//private LoaderIcon loaderApp = new LoaderIcon("Loading application....");
|
private LoaderIcon loaderApp = new LoaderIcon("Loading application... please wait");
|
||||||
|
|
||||||
private HTML attributionDiv = new HTML();
|
private HTML attributionDiv = new HTML();
|
||||||
|
|
||||||
|
@ -104,11 +109,9 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
* This is the entry point method.
|
* This is the entry point method.
|
||||||
*/
|
*/
|
||||||
public void onModuleLoad() {
|
public void onModuleLoad() {
|
||||||
|
|
||||||
// Style style = loaderApp.getElement().getStyle();
|
loaderApp.getElement().addClassName("loader-gna-app");
|
||||||
// style.setZIndex(300);
|
RootPanel.get(APP_DIV).add(loaderApp);
|
||||||
// style.setMarginTop(50,Unit.PX);
|
|
||||||
// style.setMarginLeft(50, Unit.PX);
|
|
||||||
|
|
||||||
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);
|
||||||
|
@ -119,7 +122,7 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
GWT.log(GeoportalDataViewerConstants.GET_GEONA_ITEM_ID + " = " + paramGeonaItemID);
|
GWT.log(GeoportalDataViewerConstants.GET_GEONA_ITEM_ID + " = " + paramGeonaItemID);
|
||||||
GWT.log(GeoportalDataViewerConstants.GET_LAYER_TITLE + " = " + paramLayerTitle);
|
GWT.log(GeoportalDataViewerConstants.GET_LAYER_TITLE + " = " + paramLayerTitle);
|
||||||
|
|
||||||
//RootPanel.get(APP_DIV).add(loaderApp);
|
RootPanel.get(APP_DIV).add(loaderApp);
|
||||||
|
|
||||||
mainPanel = new GeonaDataViewMainPanel(applicationBus, getClientHeight());
|
mainPanel = new GeonaDataViewMainPanel(applicationBus, getClientHeight());
|
||||||
RootPanel.get(APP_DIV).add(mainPanel);
|
RootPanel.get(APP_DIV).add(mainPanel);
|
||||||
|
@ -134,13 +137,17 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
//RootPanel.get(APP_DIV).remove(loaderApp);
|
RootPanel.get(APP_DIV).remove(loaderApp);
|
||||||
Window.alert("Error occurred on instancing the GeoPortale Viewer. Please, contact the support");
|
Window.alert("Error occurred on instancing the GeoPortale Viewer. Please, contact the support");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<BaseMapLayer> listBaseMapLayers) {
|
public void onSuccess(List<BaseMapLayer> listBaseMapLayers) {
|
||||||
//RootPanel.get(APP_DIV).remove(loaderApp);
|
try {
|
||||||
|
RootPanel.get(APP_DIV).remove(loaderApp);
|
||||||
|
}catch (Exception e) {
|
||||||
|
loaderApp.setVisible(false);
|
||||||
|
}
|
||||||
GeoportalDataViewer.listBaseMapLayers = listBaseMapLayers;
|
GeoportalDataViewer.listBaseMapLayers = listBaseMapLayers;
|
||||||
//now the map is loaded and I'm sure that I can load the GeonaDataViewer Profile
|
//now the map is loaded and I'm sure that I can load the GeonaDataViewer Profile
|
||||||
loadGeonaDataViewerProfile();
|
loadGeonaDataViewerProfile();
|
||||||
|
|
|
@ -443,4 +443,11 @@ body {
|
||||||
background-color: #f3f3f3 !important;
|
background-color: #f3f3f3 !important;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.loader-gna-app {
|
||||||
|
z-index: 50;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue