Commit b325970b authored by Yann Mombrun's avatar Yann Mombrun

Merge branch 'develop'

* develop:
  Bump to stable 2.3.4
  Take into account the conversion of projections
  Self redirect after edition of format
  Bump to next develop version 2.3.4-SNAP
parents c4805946 cb54e4e6
Pipeline #3631 passed with stage
in 44 seconds
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
......@@ -9,7 +11,7 @@
</parent>
<artifactId>weblab-metaview</artifactId>
<version>2.3.3</version>
<version>2.3.4</version>
<packaging>war</packaging>
<name>WebLab Metaview</name>
......
......@@ -70,6 +70,9 @@ public class EditMetaController {
private static final String USE_GEOSERVER_EXPOSED_MAP = "useGeoserverExposedMap";
private static final String URL_REDIRECTION = "/web/guest/docview";
private static final String LAYERS_CONFIG = "layersConfig";
......@@ -172,18 +175,18 @@ public class EditMetaController {
@ActionMapping(params = "action=cancel")
public void cancelEdit(final ActionRequest actionRequest, final ActionResponse response, final ModelMap model) throws IOException {
this.logger.debug("view redirect after cancel method called");
response.sendRedirect(EditMetaController.URL_REDIRECTION);
// build link to default portlet jsp
final String portletName = (String) actionRequest.getAttribute(WebKeys.PORTLET_ID);
final ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
final PortletURL portletURL = PortletURLFactoryUtil.create(PortalUtil.getHttpServletRequest(actionRequest), portletName, themeDisplay.getLayout().getPlid(), PortletRequest.RENDER_PHASE);
//final String portletName = (String) actionRequest.getAttribute(WebKeys.PORTLET_ID);
//final ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
//final PortletURL portletURL = PortletURLFactoryUtil.create(PortalUtil.getHttpServletRequest(actionRequest), portletName, themeDisplay.getLayout().getPlid(), PortletRequest.RENDER_PHASE);
response.sendRedirect(portletURL.toString());
//response.sendRedirect(portletURL.toString());
}
@ActionMapping(params = "action=save")
public void saveEdit(final ActionRequest request, final ActionResponse response, final ModelMap model) throws SystemException {
public void saveEdit(final ActionRequest request, final ActionResponse response, final ModelMap model) throws SystemException, IOException {
this.logger.debug("saveEdit method called");
if (!this.permissionService.hasAdminRole(request)) {
......@@ -213,5 +216,6 @@ public class EditMetaController {
}
model.addAttribute(EditMetaController.RESOURCE, resource);
request.getPortletSession().setAttribute("model", model);
response.sendRedirect(EditMetaController.URL_REDIRECTION);
}
}
function openLayerMap(useGeoserverExposedMap, serverUrlPrefix, layersConfig) {
console.log(layersConfig.projection);
if (jQuery('#longEdit').length) {
var htmlLon = jQuery('#longEdit');
var htmlLat = jQuery('#latEdit');
......@@ -18,7 +18,7 @@ function openLayerMap(useGeoserverExposedMap, serverUrlPrefix, layersConfig) {
var iconFeature = new ol.Feature();
if (!isNaN(lon) && !isNaN(lat)) {
centerMap = convertToMap([ lon, lat ]);
centerMap = convertToMap([lon, lat], layersConfig.projection);
setCoordMarker(centerMap);
}
......@@ -91,10 +91,10 @@ function openLayerMap(useGeoserverExposedMap, serverUrlPrefix, layersConfig) {
map.on('singleclick', function(evt) {
if (jQuery('#longEdit').length) {
console.log("map editable");
var coord = evt.coordinate;
setCoordMarker(coord);
setLonLatInput(convertToLonLat(coord));
console.log(coord);
setLonLatInput(convertToLonLat(coord, layersConfig.projection));
}
});
......@@ -112,7 +112,8 @@ function openLayerMap(useGeoserverExposedMap, serverUrlPrefix, layersConfig) {
lon = parseFloat(htmlLon.val());
lat = parseFloat(htmlLat.val());
if (!isNaN(lon) && !isNaN(lat)) {
setCoordMarker(convertToMap([ lon, lat ]));
console.log(layersConfig.projection);
setCoordMarker(convertToMap([lon, lat], layersConfig.projection));
}
}
htmlLon.change(changeEvt);
......@@ -138,15 +139,15 @@ function openLayerMap(useGeoserverExposedMap, serverUrlPrefix, layersConfig) {
iconGeometry.setCoordinates(coord);
}
function convertToMap(lonlat) {
return ol.proj.fromLonLat(lonlat);
function convertToMap(lonlat, projection) {
return ol.proj.transform(lonlat, 'EPSG:4326', projection);
}
function convertToLonLat(coord) {
return ol.proj.toLonLat(coord);
function convertToLonLat(coord, projection) {
return (projection =='EPSG:4326') ? coord : ol.proj.transform(coord, projection, 'EPSG:4326');
}
function centerToGeolocation(position) {
view.setCenter(convertToMap([ position.coords.longitude, position.coords.latitude ]));
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment