merged with feature 19207
This commit is contained in:
parent
d1e48b63f6
commit
cb0bf23241
14
.classpath
14
.classpath
|
@ -8,7 +8,12 @@
|
|||
</classpathentry>
|
||||
<classpathentry kind="src" path="src/main/test"/>
|
||||
<classpathentry kind="src" path="src/main/resources"/>
|
||||
<classpathentry kind="src" path="src/test/resources"/>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
|
@ -20,5 +25,12 @@
|
|||
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
encoding//src/test/resources=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
|
|
|
@ -3,6 +3,9 @@ org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset
|
||||
component="org.gcube.portlets-user.GISViewer.4-5-0" date="2020-05-07">
|
||||
<Change>[Task #19207]: init parameter to set max zoom level
|
||||
</Change>
|
||||
</Changeset>
|
||||
<Changeset
|
||||
component="org.gcube.portlets-user.GISViewer.4-4-0" date="2020-04-21">
|
||||
<Change>[Feature #19111]: init settings configurable via property file
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -11,7 +11,7 @@
|
|||
|
||||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>gis-viewer</artifactId>
|
||||
<version>4.4.0</version>
|
||||
<version>4.5.0-SNAPSHOT</version>
|
||||
<name>GIS Viewer Widget</name>
|
||||
<description>
|
||||
GWT Widget application to access GIS Data
|
||||
|
|
|
@ -13,7 +13,7 @@ import com.google.gwt.core.client.GWT;
|
|||
*/
|
||||
public class Constants {
|
||||
|
||||
public static String VERSION = "4.4.0";
|
||||
public static String VERSION = "4.5.0";
|
||||
public static String GCUBE_TOKEN = "d7a4076c-e8c1-42fe-81e0-bdecb1e8074a"; //A STATIC GCUBE TOKEN FOR TEST
|
||||
public static final Float DEFAULT_XY_WPS_RESOLUTION = new Float(0.5);
|
||||
public static final String DOWNLOAD_WSF_FEATURES_SERVICE = GWT.getModuleBaseURL() + "DownloadWFSFeatures";
|
||||
|
@ -111,6 +111,7 @@ public class Constants {
|
|||
public static final String FAO_DATA_STORE = "FI Geoserver";
|
||||
public static final String FAO_DATA_STORE_PREFIX = "fifao_";
|
||||
public static final int numZoomLevels = 14;
|
||||
public static final int numMAXZoomLevels = 25;
|
||||
|
||||
public static final String defaultScope = "/gcube/devsec/devVRE";
|
||||
// public static final String defaultScope = "/d4science.research-infrastructures.eu/gCubeApps/EcologicalModelling";
|
||||
|
|
|
@ -39,7 +39,6 @@ import org.gcube.portlets.user.gisviewer.client.openlayers.ToolbarHandler;
|
|||
import org.gcube.portlets.user.gisviewer.client.resources.Images;
|
||||
import org.gcube.portlets.user.gisviewer.client.resources.Resources;
|
||||
import org.gcube.portlets.user.gisviewer.client.util.SizedLabel;
|
||||
import org.gwtopenmaps.openlayers.client.LonLat;
|
||||
|
||||
import com.extjs.gxt.ui.client.Style.Scroll;
|
||||
import com.extjs.gxt.ui.client.core.XDOM;
|
||||
|
@ -159,11 +158,7 @@ implements ToolbarHandler, DataPanelHandler, LayersPanelHandler, CqlFilterHandle
|
|||
INSTANCE = this;
|
||||
// create an empty layers panel
|
||||
layersPanel = new LayersPanel(this);
|
||||
|
||||
//TEMPORARY SOLUTION. MUST BECOME INIT PARAMETERS
|
||||
LonLat centerMapTo = null; //new LonLat(12.45, 42.98);
|
||||
Integer initZoomTo = null;
|
||||
createOpenLayersMap(centerMapTo, initZoomTo);
|
||||
createOpenLayersMap(parameters.getOpenLayersMapParameters());
|
||||
|
||||
// initialize the layout
|
||||
this.setLayout(new FitLayout());
|
||||
|
@ -358,7 +353,7 @@ implements ToolbarHandler, DataPanelHandler, LayersPanelHandler, CqlFilterHandle
|
|||
/**
|
||||
* Creates the open layers map.
|
||||
*/
|
||||
private void createOpenLayersMap(final LonLat centerMapTo, final Integer initZoomTo) { // TODO update for pluggable layers
|
||||
private void createOpenLayersMap(final OpenLayersMapParameters openLayersMapParameters) { // TODO update for pluggable layers
|
||||
|
||||
GisViewer.service.getBaseLayersToGisViewer(new AsyncCallback<List<? extends GisViewerBaseLayerInterface>>() {
|
||||
|
||||
|
@ -375,8 +370,7 @@ implements ToolbarHandler, DataPanelHandler, LayersPanelHandler, CqlFilterHandle
|
|||
Constants.numZoomLevels,
|
||||
"GisViewer ver. "+Constants.VERSION,
|
||||
result,
|
||||
centerMapTo,
|
||||
initZoomTo,
|
||||
openLayersMapParameters,
|
||||
INSTANCE);
|
||||
|
||||
toolBarPanel = new ToolBarPanel(INSTANCE, openLayersMap);
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package org.gcube.portlets.user.gisviewer.client;
|
||||
|
||||
import org.gwtopenmaps.openlayers.client.LonLat;
|
||||
|
||||
// TODO: Auto-generated Javadoc
|
||||
/**
|
||||
* The Class GisViewerParameters.
|
||||
|
@ -16,8 +14,7 @@ public class GisViewerParameters {
|
|||
private DataPanelOpenListener dataPanelOpenHandler = null;
|
||||
private boolean openDataPanelAtStart = Constants.geoWindowDataPanelOpenedAtStart;
|
||||
private boolean openLayerPanelAtStart = Constants.geoWindowLayerPanelOpenedAtStart;
|
||||
private LonLat centerMapTo = null; //new LonLat(12.45, 42.98);
|
||||
private Integer initZoomTo = null;
|
||||
private OpenLayersMapParameters openLayersMapParameters = null;
|
||||
|
||||
/**
|
||||
* Instantiates a new gis viewer parameters.
|
||||
|
@ -37,7 +34,6 @@ public class GisViewerParameters {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Instantiates a new gis viewer parameters.
|
||||
*
|
||||
|
@ -46,22 +42,17 @@ public class GisViewerParameters {
|
|||
* @param dataPanelOpenHandler the data panel open handler
|
||||
* @param openDataPanelAtStart the open data panel at start
|
||||
* @param openLayerPanelAtStart the open layer panel at start
|
||||
* @param centerMapTo the center map to
|
||||
* @param initZoomTo the init zoom to
|
||||
*/
|
||||
public GisViewerParameters(String projection, GisViewerSaveHandler gisViewerSaveHandler,
|
||||
DataPanelOpenListener dataPanelOpenHandler, boolean openDataPanelAtStart, boolean openLayerPanelAtStart,
|
||||
LonLat centerMapTo, Integer initZoomTo) {
|
||||
DataPanelOpenListener dataPanelOpenHandler, boolean openDataPanelAtStart, boolean openLayerPanelAtStart) {
|
||||
super();
|
||||
this.projection = projection;
|
||||
this.gisViewerSaveHandler = gisViewerSaveHandler;
|
||||
this.dataPanelOpenHandler = dataPanelOpenHandler;
|
||||
this.openDataPanelAtStart = openDataPanelAtStart;
|
||||
this.openLayerPanelAtStart = openLayerPanelAtStart;
|
||||
this.centerMapTo = centerMapTo;
|
||||
this.initZoomTo = initZoomTo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if is open layer panel at start.
|
||||
*
|
||||
|
@ -152,42 +143,6 @@ public class GisViewerParameters {
|
|||
return dataPanelOpenHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the center map to.
|
||||
*
|
||||
* @return the center map to
|
||||
*/
|
||||
public LonLat getCenterMapTo() {
|
||||
return centerMapTo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the center map to.
|
||||
*
|
||||
* @param centerMapTo the new center map to
|
||||
*/
|
||||
public void setCenterMapTo(LonLat centerMapTo) {
|
||||
this.centerMapTo = centerMapTo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the inits the zoom to.
|
||||
*
|
||||
* @return the inits the zoom to
|
||||
*/
|
||||
public Integer getInitZoomTo() {
|
||||
return initZoomTo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the inits the zoom to.
|
||||
*
|
||||
* @param initZoomTo the new inits the zoom to
|
||||
*/
|
||||
public void setInitZoomTo(Integer initZoomTo) {
|
||||
this.initZoomTo = initZoomTo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the data panel open handler.
|
||||
*
|
||||
|
@ -196,6 +151,24 @@ public class GisViewerParameters {
|
|||
public void setDataPanelOpenHandler(DataPanelOpenListener dataPanelOpenHandler) {
|
||||
this.dataPanelOpenHandler = dataPanelOpenHandler;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the open layers map parameters.
|
||||
*
|
||||
* @return the open layers map parameters
|
||||
*/
|
||||
public OpenLayersMapParameters getOpenLayersMapParameters() {
|
||||
return openLayersMapParameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the open layers map parameters.
|
||||
*
|
||||
* @param openLayersMapParameters the new open layers map parameters
|
||||
*/
|
||||
public void setOpenLayersMapParameters(OpenLayersMapParameters openLayersMapParameters) {
|
||||
this.openLayersMapParameters = openLayersMapParameters;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
package org.gcube.portlets.user.gisviewer.client;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* The Class OpenLayersMapParameters.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR Pisa (Italy)
|
||||
* May 7, 2020
|
||||
*/
|
||||
public class OpenLayersMapParameters {
|
||||
|
||||
|
||||
private Map<String,String> mapToInitOLMap = new HashMap<String, String>();
|
||||
|
||||
public enum OL_MAP_PARAM {maxzoomlevel,zoom,centermap}
|
||||
|
||||
/**
|
||||
* Instantiates a new gis viewer map parameters.
|
||||
*/
|
||||
public OpenLayersMapParameters() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the parameter.
|
||||
*
|
||||
* @param key the key
|
||||
* @param value the value
|
||||
*/
|
||||
public void addParameter(String key, String value) {
|
||||
mapToInitOLMap.put(key, value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds the parameter.
|
||||
*
|
||||
* @param key the key
|
||||
* @param value the value
|
||||
*/
|
||||
public void addParameter(OL_MAP_PARAM key, String value) {
|
||||
if(key!=null)
|
||||
mapToInitOLMap.put(key.name(), value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the pameter.
|
||||
*
|
||||
* @param key the key
|
||||
* @return the pameter
|
||||
*/
|
||||
public String getPameter(String key) {
|
||||
return mapToInitOLMap.get(key);
|
||||
}
|
||||
}
|
|
@ -5,6 +5,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.gisviewer.client.Constants;
|
||||
import org.gcube.portlets.user.gisviewer.client.OpenLayersMapParameters;
|
||||
import org.gcube.portlets.user.gisviewer.client.commons.beans.GisViewerBaseLayerInterface;
|
||||
import org.gcube.portlets.user.gisviewer.client.commons.beans.LayerItem;
|
||||
import org.gcube.portlets.user.gisviewer.client.commons.beans.MapViewInfo;
|
||||
|
@ -39,6 +40,7 @@ import org.gwtopenmaps.openlayers.client.layer.VectorOptions;
|
|||
import org.gwtopenmaps.openlayers.client.layer.WMS;
|
||||
import org.gwtopenmaps.openlayers.client.layer.WMSOptions;
|
||||
import org.gwtopenmaps.openlayers.client.layer.WMSParams;
|
||||
import org.gwtopenmaps.openlayers.client.tile.TileOptions;
|
||||
import org.gwtopenmaps.openlayers.client.util.JObjectArray;
|
||||
import org.gwtopenmaps.openlayers.client.util.JSObject;
|
||||
|
||||
|
@ -170,17 +172,61 @@ public class OpenLayersMap {
|
|||
int numZoomLevels,
|
||||
String title,
|
||||
List<? extends GisViewerBaseLayerInterface> baseLayers,
|
||||
final LonLat centerMapTo,
|
||||
final Integer initZoomTo,
|
||||
final OpenLayersMapParameters openLayersMapParameters,
|
||||
final OpenLayersHandler handler) {
|
||||
|
||||
this.handler = handler;
|
||||
this.numZoomLevels = numZoomLevels;
|
||||
//this.projection = defaultBounds.;
|
||||
// set map options
|
||||
|
||||
|
||||
//Managing maxzoomlevel parameter TO OL MAP
|
||||
String maxzoomlevel = openLayersMapParameters.getPameter(OpenLayersMapParameters.OL_MAP_PARAM.maxzoomlevel.name());
|
||||
try {
|
||||
if(maxzoomlevel!=null) {
|
||||
int maxZoom = Integer.parseInt(maxzoomlevel);
|
||||
this.numZoomLevels = maxZoom<=Constants.numMAXZoomLevels?maxZoom:Constants.numZoomLevels;
|
||||
}
|
||||
}catch (Exception e) {
|
||||
GWT.log("BAD value: "+maxzoomlevel+" for parameter: "+OpenLayersMapParameters.OL_MAP_PARAM.maxzoomlevel);
|
||||
}
|
||||
|
||||
//Managing zoom parameter TO OL MAP
|
||||
String paramZoom = openLayersMapParameters.getPameter(OpenLayersMapParameters.OL_MAP_PARAM.zoom.name());
|
||||
try {
|
||||
if(paramZoom!=null) {
|
||||
int zoomTo = Integer.parseInt(paramZoom);
|
||||
setZoomLevel(zoomTo);
|
||||
}
|
||||
}catch (Exception e) {
|
||||
GWT.log("BAD value: "+paramZoom+" for parameter: "+OpenLayersMapParameters.OL_MAP_PARAM.zoom);
|
||||
}
|
||||
|
||||
//Managing centermap parameter TO OL MAP
|
||||
String centerMapTo = openLayersMapParameters.getPameter(OpenLayersMapParameters.OL_MAP_PARAM.centermap.name());
|
||||
if(centerMapTo!=null) {
|
||||
|
||||
LonLat lonlat = null;
|
||||
try {
|
||||
String[] theLongLat = centerMapTo.split(",");
|
||||
lonlat = new LonLat(Double.parseDouble(theLongLat[0]), Double.parseDouble(theLongLat[1]));
|
||||
//gisViewerPanel.getOpenLayersMap().setCenterAt(lonlat);
|
||||
|
||||
}catch (Exception e1) {
|
||||
GWT.log("BAD value: "+centerMapTo+" for parameter: "+OpenLayersMapParameters.OL_MAP_PARAM.centermap);
|
||||
}
|
||||
|
||||
if(lonlat!=null) {
|
||||
final LonLat theLonlat = lonlat;
|
||||
setCenterAt(theLonlat);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MapOptions mapOptions = new MapOptions();
|
||||
mapOptions.setControls(new JObjectArray(new JSObject[] {}));
|
||||
mapOptions.setNumZoomLevels(numZoomLevels);
|
||||
mapOptions.setNumZoomLevels(this.numZoomLevels);
|
||||
mapOptions.setProjection(Constants.defaultProjection);
|
||||
mapOptions.setZIndexBase(new ZIndexBaseGisViewer());
|
||||
|
||||
|
@ -254,21 +300,6 @@ public class OpenLayersMap {
|
|||
addControl(new LayerSwitcher());
|
||||
addTransectControl();
|
||||
addBoxControl();
|
||||
|
||||
if(centerMapTo!=null) {
|
||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
GWT.log("Centering on: "+centerMapTo);
|
||||
//map.setCenter(new LonLat(12.45, 42.98), 6);
|
||||
if(initZoomTo!=null)
|
||||
map.setCenter(centerMapTo,initZoomTo);
|
||||
else
|
||||
map.setCenter(centerMapTo);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -966,45 +997,6 @@ public class OpenLayersMap {
|
|||
if(baseLayerInterface.isDisplay())
|
||||
addBaseLayerToOpenLayerMap(baseLayerInterface.getTitle(), baseLayerInterface.getName(), baseLayerInterface.getWmsServiceBaseURL());
|
||||
}
|
||||
|
||||
|
||||
// options = new GoogleV3Options();
|
||||
// options.setIsBaseLayer(true);
|
||||
// options.setDisplayInLayerSwitcher(true);
|
||||
// options.setType(GoogleV3MapType.G_TERRAIN_MAP);
|
||||
// googleLayer = new GoogleV3("Google Terrain", options);
|
||||
// map.addLayer(googleLayer);
|
||||
//
|
||||
// reproject
|
||||
// MapOptions mapOptions = new MapOptions();
|
||||
// mapOptions.setControls(new JObjectArray(new JSObject[] {}));
|
||||
// mapOptions.setNumZoomLevels(this.numZoomLevels);
|
||||
// mapOptions.setProjection("EPSG:900913");
|
||||
// mapOptions.setMaxExtent(new Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34));
|
||||
// mapOptions.setMaxResolutionToAuto();
|
||||
// mapWidget.getMap().setOptions(mapOptions);
|
||||
|
||||
|
||||
// addBaseLayer("Blue Marble", "bluemarble_1", "http://iceds.ge.ucl.ac.uk/cgi-bin/icedswms");
|
||||
// addBaseLayerToOpenLayerMap("Global Surface Relief", "etopo1_ice:z", "http://oos.soest.hawaii.edu/erddap/wms/etopo1_ice/request");
|
||||
// addBaseLayerToOpenLayerMap("Shaded Relief", "shaded_relief", "http://maps.ngdc.noaa.gov/soap/etopo1/MapServer/WMSServer");
|
||||
// addBaseLayerToOpenLayerMap("Dem", "dem", "http://maps.ngdc.noaa.gov/soap/etopo1/MapServer/WMSServer");
|
||||
// addBaseLayerToOpenLayerMap("Etopo180", "etopo180:altitude", "http://coastwatch.pfeg.noaa.gov/erddap/wms/erdBAssta5day/request");
|
||||
// addBaseLayerToOpenLayerMap("Groundwater Map", "bgr_groundwater_whymap", "http://www.bgr.de/Service/groundwater/whymap/");
|
||||
// addBaseLayerToOpenLayerMap("LandMask", "LandMask", "http://oos.soest.hawaii.edu/erddap/wms/etopo1_ice/request");
|
||||
// addBaseLayerToOpenLayerMap("Coastlines", "Coastlines", "http://oos.soest.hawaii.edu/erddap/wms/etopo1_ice/request");
|
||||
//// addBaseLayer("test2", "NWW3_Global_Best:Tdir", "http://oos.soest.hawaii.edu/erddap/wms/NWW3_Global_Best/request");
|
||||
// addBaseLayerToOpenLayerMap("GEBCO", "GEBCO_08_Grid", "http://www.gebco.net/data_and_products/web_map_service/mapserv/request");
|
||||
// addBaseLayerToOpenLayerMap("test2", "", ""); // do not anything
|
||||
|
||||
//var extent = new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34); //-2200000,-712631,3072800,3840000);
|
||||
|
||||
// map = new OpenLayers.Map( 'map', {
|
||||
// allOverlays: true,
|
||||
// maxExtent: extent,
|
||||
// projection: '900913' //'EPSG:42304'
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1063,6 +1055,13 @@ public class OpenLayersMap {
|
|||
WMSOptions wmsOptions = new WMSOptions();
|
||||
wmsOptions.setIsBaseLayer(layerItem.isBaseLayer());
|
||||
wmsOptions.setWrapDateLine(true); // default
|
||||
|
||||
if(layerItem.isBaseLayer()) {
|
||||
TileOptions tileOpt = new TileOptions();
|
||||
tileOpt.setParameter("tiled", "true");
|
||||
//wmsOptions.setTileSize(new Size(128, 128));
|
||||
wmsOptions.setTileOptions(tileOpt);
|
||||
}
|
||||
// wmsOptions.setTransitionEffect(TransitionEffect.RESIZE);
|
||||
|
||||
WMSParams wmsParams = new WMSParams();
|
||||
|
@ -1149,11 +1148,22 @@ public class OpenLayersMap {
|
|||
*
|
||||
* @param zoomLevel the new zoom level
|
||||
*/
|
||||
public void setZoomLevel(int zoomLevel) {
|
||||
public void setZoomLevel(final int zoomLevel) {
|
||||
// GWT.log("setting zoom at: "+zoomLevel);
|
||||
// if(zoomLevel>0 && zoomLevel<numZoomLevels+1) {
|
||||
// map.zoomTo(zoomLevel);
|
||||
// }
|
||||
|
||||
GWT.log("setting zoom at: "+zoomLevel);
|
||||
if(zoomLevel>0 && zoomLevel<numZoomLevels+1) {
|
||||
map.zoomTo(zoomLevel);
|
||||
}
|
||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
if(zoomLevel>0 && zoomLevel<numZoomLevels+1) {
|
||||
map.zoomTo(zoomLevel);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
@ -1162,11 +1172,17 @@ public class OpenLayersMap {
|
|||
*
|
||||
* @param lonLat the new center at
|
||||
*/
|
||||
public void setCenterAt(LonLat lonLat) {
|
||||
GWT.log("setting center at: "+lonLat);
|
||||
if(lonLat!=null) {
|
||||
map.setCenter(lonLat);
|
||||
}
|
||||
public void setCenterAt(final LonLat lonLat) {
|
||||
|
||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
if(lonLat!=null) {
|
||||
map.setCenter(lonLat);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue