added set scope

This commit is contained in:
Francesco Mangiacrapa 2020-11-10 16:46:28 +01:00
parent ab8119be2e
commit 6c495119b9
2 changed files with 33 additions and 0 deletions

View File

@ -23,6 +23,9 @@ import ol.layer.Tile;
import ol.layer.VectorLayerOptions;
import ol.proj.Projection;
import ol.proj.ProjectionOptions;
import ol.source.ImageWms;
import ol.source.ImageWmsOptions;
import ol.source.ImageWmsParams;
import ol.source.Osm;
import ol.source.XyzOptions;
import ol.style.FillOptions;
@ -152,6 +155,35 @@ import ol.style.Style;
}
/**
* Adds the WMS layer.
*
* @param mapServerHost the map server host
* @param layerName the layer name
*/
public void addWMSLayer(String mapServerHost, String layerName) {
ImageWmsParams imageWMSParams = OLFactory.createOptions();
imageWMSParams.setLayers(layerName);
ImageWmsOptions imageWMSOptions = OLFactory.createOptions();
imageWMSOptions.setUrl(mapServerHost);
imageWMSOptions.setParams(imageWMSParams);
//imageWMSOptions.setRatio(1.5f);
ImageWms imageWMSSource = new ImageWms(imageWMSOptions);
LayerOptions layerOptions = OLFactory.createOptions();
layerOptions.setSource(imageWMSSource);
ol.layer.Image wmsLayer = new ol.layer.Image(layerOptions);
//visibleLayerItems
map.addLayer(wmsLayer);
}
public void addPoint(Coordinate coordinate) {
if(geometryLayer!=null) {

View File

@ -121,6 +121,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
try {
LOG.info("Trying to get record for id "+id);
SessionUtil.getCurrentContext(this.getThreadLocalRequest(), true);
AbstractRecordManager<Record> abmRecord = ManagerFactory.getByRecordID(id);
LOG.info("Got record for id "+id);
Record record = abmRecord.getRecord();