fixed baloon position

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/gis-viewer-app@113649 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2015-03-18 16:21:45 +00:00
parent dcce96c65d
commit ef6c359f30
5 changed files with 70 additions and 30 deletions

View File

@ -14,9 +14,9 @@
</attributes>
</classpathentry>
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
@ -25,9 +25,9 @@
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/gis-viewer-app/WEB-INF/classes"/>

View File

@ -3,7 +3,7 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<dependent-module archiveName="gis-viewer-3.6.2-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gis-viewer-TRUNK/gis-viewer-TRUNK">
<dependent-module archiveName="gis-viewer-3.6.2-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gis-viewer-PRIVATE/gis-viewer-PRIVATE">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>

View File

@ -135,6 +135,8 @@
<configuration>
<runTarget>GisViewerApp.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<!-- Remove PRETTY to deploy in production -->
<!-- <style>PRETTY</style> -->
</configuration>
</plugin>
@ -153,8 +155,8 @@
</executions>
<configuration>
<webappDirectory>${webappDirectory}</webappDirectory>
<!-- COPY GWT-GXT FIX-->
<!-- COPY GWT-GXT FIX -->
<webResources>
<resource>
<directory>lib</directory>

View File

@ -96,8 +96,10 @@ public class ApplicationController implements WmsDialogHandler{
@Override
protected void onExpand() {
super.onExpand();
if (gisViewerPanel!=null)
gisViewerPanel.updateOpenLayersSize();
// resizeBar.show();
}
@ -134,9 +136,7 @@ public class ApplicationController implements WmsDialogHandler{
// ConstantGisViewerApp.logger.log(Level.INFO, "Replacing all "+replacement);
// wmsRequest = wmsRequest.replaceAll(replacement, wmsRequest);
// }
try {
wmsRequestConverter.parseRequest(wmsRequest,null);
wmsRequestConverter.addRequestToGisViewer();
@ -185,12 +185,31 @@ public class ApplicationController implements WmsDialogHandler{
public GisViewerPanel getGisViewerPanel() {
return gisViewerPanel;
}
/**
* Sets the new position.
*
* @param scrollTop the scroll top
* @param left the left
* @param height the height
*/
public void setWMSBalloonPosition(int scrollTop, int left, int height){
// GWT.log("height: "+height +" scrollTop: "+scrollTop);
scrollTop= scrollTop>0?scrollTop:1;
height = height>0?height:1;
int newPosition = scrollTop+height;
// GWT.log("new position: "+newPosition);
baloonWMS.setVisible(false);
baloonWMS.show();
baloonWMS.setPopupPosition(left>0?left:1, newPosition-35);
baloonWMS.setVisible(true);
}
/**
*
* @return the baloonWMS
*/
public void moveWMSBalloon() {
baloonWMS.showRelativeTo(lcWMS);
public BaloonPanel getBaloonWMS() {
return baloonWMS;
}
/* (non-Javadoc)

View File

@ -39,16 +39,19 @@ public class GisViewerApp implements EntryPoint {
options.setDisplayInLayerSwitcher(true);
options.setIsBaseLayer(true);
String name = "MapBox";
String url = "https://b.tiles.mapbox.com/v4/examples.map-2k9d7u0c/${z}/${x}/${y}.png?access_token=pk.eyJ1IjoidHJpc3RlbiIsImEiOiJiUzBYOEJzIn0.VyXs9qNWgTfABLzSI3YcrQ";
XYZ layer = new XYZ(name, url, options);
MapWidget widget = appController.getGisViewerPanel().getOpenLayersMap().getMapWidget();
widget.getMap().addLayer(layer);
*/
/*
OSMOptions options = new OSMOptions();
MapWidget mapWidget = appController.getGisViewerPanel().getOpenLayersMap().getMapWidget();
LonLat lonLat = new LonLat(6.95, 50.94);
lonLat.transform("EPSG:4326", "EPSG:900913");
mapWidget.getMap().addLayer(layer);
mapWidget.getMap().setCenter(lonLat);*/
/* OSMOptions options = new OSMOptions();
options.setNumZoomLevels(Constants.numZoomLevels);
options.setProjection(Constants.defaultProjection);
options.crossOriginFix();
@ -64,7 +67,23 @@ public class GisViewerApp implements EntryPoint {
OSM osm3 = new OSM("OSM Humaritarian","http://b.tile.openstreetmap.fr/hot/${z}/${x}/${y}.png", options);
osm3.setIsBaseLayer(true);
mapWdg.getMap().addLayer(osm3);
mapWdg.getMap().addLayer(osm3);*/
/*
OSM osmMapnik = OSM.Mapnik("Mapnik");
OSM osmCycle = OSM.CycleMap("CycleMap");
osmMapnik.setIsBaseLayer(true);
osmCycle.setIsBaseLayer(true);
MapWidget mapWidget = appController.getGisViewerPanel().getOpenLayersMap().getMapWidget();
mapWidget.getMap().addLayer(osmMapnik);
mapWidget.getMap().addLayer(osmCycle);
LonLat lonLat = new LonLat(6.95, 50.94);
lonLat.transform("EPSG:4326", mapWidget.getMap().getProjection()); //transform lonlat (provided in EPSG:4326) to OSM coordinate system (the map projection)
mapWidget.getMap().setCenter(lonLat, Constants.numZoomLevels);
*/
appController.getGisViewerPanel().showIntro();
@ -76,24 +95,24 @@ public class GisViewerApp implements EntryPoint {
public void updateSize(){
RootPanel workspace = RootPanel.get(GISVIEWERAPPDIV);
int topBorder = workspace.getAbsoluteTop();
int leftBorder = workspace.getAbsoluteLeft();
int footer = 2; //footer is bottombar + sponsor
int rootHeight = (Window.getClientHeight() - topBorder - 4 - footer);// - ((footer == null)?0:(footer.getOffsetHeight()-15));
// if (rootHeight < 550)
// rootHeight = 550;
int rootWidth = Window.getClientWidth() - 2* leftBorder; //- rightScrollBar;
System.out.println("New workspace dimension Height: "+rootHeight+" Width: "+rootWidth);
appController.getMainPanel().setHeight(rootHeight);
appController.getMainPanel().setWidth(rootWidth);
appController.moveWMSBalloon();
appController.getBaloonWMS().hide();
int scroll = Window.getScrollTop();
int left = Window.getScrollLeft();
int height = Window.getClientHeight();
// GWT.log("onResize height: "+Window.getClientHeight());
appController.setWMSBalloonPosition(scroll, left, height);
// appController.getGisViewerPanel().getOpenLayersMap().centerMapCurrentZoom();
}
}