Skip to content

Commit

Permalink
- fix #9464: fix issue of not showing background layer in case of swi…
Browse files Browse the repository at this point in the history
…tching from 2D mode to 3D mode
  • Loading branch information
mahmoudadel54 committed Oct 23, 2023
1 parent e9d8bd0 commit 8eacc19
Show file tree
Hide file tree
Showing 6 changed files with 339 additions and 110 deletions.
81 changes: 81 additions & 0 deletions docs/developer-guide/mapstore-migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,87 @@ This is a list of things to check if you want to update from a previous version
- Optionally check also accessory files like `.eslinrc`, if you want to keep aligned with lint standards.
- Follow the instructions below, in order, from your version to the one you want to update to.

## Migration from 2023.02.xx to 2024.01.00

### Adding spatial filter to dashboard widgets

In order to enable the possibility to add in and the spatial filter to the widgets ( see [#9098](https://github.com/geosolutions-it/MapStore2/issues/9098) ) you have to edit the `QueryPanel` config in the `plugins.dashboard` array of the `localConfig.json` file by adding:

- **useEmbeddedMap**: flag to enable the embedded map
- **spatialOperations**: The list of spatial operations allowed for this plugin
- **spatialMethodOptions**: the list of spatial methods to use.

```json
...
"dashboard": [
...
{
"name": "QueryPanel",
"cfg": {
"toolsOptions": {
"hideCrossLayer": true,
"useEmbeddedMap": true
},
"spatialPanelExpanded": false,
"spatialOperations": [
{"id": "INTERSECTS", "name": "queryform.spatialfilter.operations.intersects"},
{"id": "CONTAINS", "name": "queryform.spatialfilter.operations.contains"},
{"id": "WITHIN", "name": "queryform.spatialfilter.operations.within"}
],
"spatialMethodOptions": [
{"id": "BBOX", "name": "queryform.spatialfilter.methods.box"},
{"id": "Circle", "name": "queryform.spatialfilter.methods.circle"},
{"id": "Polygon", "name": "queryform.spatialfilter.methods.poly"}
],
"containerPosition": "columns"
}
}

```

### MapFish Print update

The **MapFish Print** library has been updated to work with the latest GeoTools version and Java 11 as well as being aligned with the same dependency used by the official GeoServer printing extension (see this issue <https://github.com/geosolutions-it/mapfish-print/issues/65>)
For this reason, if you are using the printing plugin in your project you have to update it by following the following steps:

- Change the version of the mapfish-print dependency in the project `pom.xml` file:

```diff
<!-- mapfish-print -->
<dependency>
<groupId>org.mapfish.print</groupId>
<artifactId>print-lib</artifactId>
- <version>geosolutions-2.3-SNAPSHOT</version>
+ <version>2.3-SNAPSHOT</version>

```

- Add the mvn repository where this library is hosted in the `repositories` section of the same `pom.xml` (usually in `web` folder of a project)

```diff
<repository>
<id>osgeo-snapshot</id>
<name>Open Source Geospatial Foundation Repository</name>
<url>https://repo.osgeo.org/repository/snapshot/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
```

### Annotations plugin refactor

The Annotation plugin has been updated to be supported also in 3D maps. This update introduced some changes:

- All the configurations related to the "Annotations" plugin has been removed from `localConfig.json` `defaultState` entry and moved to the `cfg` property of the plugin
- The annotations reducers is not needed anymore inside the default reducers of the app

Please update by:

- Removing `annotations` entry from your `localConfig.json` `defaultState`
- If you customized the app, you can remove the `annotations` reducer from default reducers.
- If some customizations were applied to the Annotations plugin in `defaultState`, apply these changes to the plugin configuration, following the documentation of the plugin.

## Migration from 2023.01.02 to 2023.02.00

### About plugin cfg changes
Expand Down
2 changes: 1 addition & 1 deletion web/client/components/map/cesium/Layer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class CesiumLayer extends React.Component {
return false;
}
}
return visibility !== false;
return visibility;
};

setLayerOpacity = (opacity) => {
Expand Down
12 changes: 8 additions & 4 deletions web/client/components/map/cesium/__tests__/Layer-test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ describe('Cesium layer', () => {
});

it('creates a osm layer for cesium map', () => {
var options = {};
var options = {
visibility: true
};
// create layers
var layer = ReactDOM.render(
<CesiumLayer type="osm"
Expand All @@ -113,7 +115,8 @@ describe('Cesium layer', () => {
"source": "osm",
"title": "Open Street Map",
"name": "mapnik",
"group": "background"
"group": "background",
"visibility": true
};
// create layer
var layer = ReactDOM.render(
Expand Down Expand Up @@ -455,7 +458,8 @@ describe('Cesium layer', () => {
"title": "Bing Aerial",
"name": "Aerial",
"group": "background",
"apiKey": "required"
"apiKey": "required",
"visibility": true
};
// create layers
var layer = ReactDOM.render(
Expand All @@ -472,7 +476,7 @@ describe('Cesium layer', () => {
options={{}} position={0} map={map}/>, document.getElementById("container"));

expect(layer).toExist();
expect(map.imageryLayers.length).toBe(1);
expect(map.imageryLayers.length).toBe(0);
// not visibile layers are removed from the leaflet maps
layer = ReactDOM.render(
<CesiumLayer type="osm"
Expand Down
18 changes: 9 additions & 9 deletions web/client/components/map/cesium/__tests__/Map-test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,9 @@ describe('CesiumMap', () => {
act(() => {
ReactDOM.render(
<CesiumMap ref={value => { ref = value; } } id="mymap" center={{ y: 43.9, x: 10.3 }} zoom={11}>
<CesiumLayer type="wms" position={1} options={{ url: '/wms', name: 'layer01' }} />
<CesiumLayer type="wms" position={3} options={{ url: '/wms', name: 'layer02' }} />
<CesiumLayer type="wms" position={6} options={{ url: '/wms', name: 'layer03' }} />
<CesiumLayer type="wms" position={1} options={{ url: '/wms', name: 'layer01', "visibility": true }} />
<CesiumLayer type="wms" position={3} options={{ url: '/wms', name: 'layer02', "visibility": true }} />
<CesiumLayer type="wms" position={6} options={{ url: '/wms', name: 'layer03', "visibility": true }} />
</CesiumMap>,
document.getElementById('container')
);
Expand All @@ -455,9 +455,9 @@ describe('CesiumMap', () => {
act(() => {
ReactDOM.render(
<CesiumMap ref={value => { ref = value; } } id="mymap" center={{ y: 43.9, x: 10.3 }} zoom={11}>
<CesiumLayer type="wms" position={1} options={{ url: '/wms', name: 'layer01' }} />
<CesiumLayer type="wms" position={3} options={{ url: '/wms', name: 'layer02' }} />
<CesiumLayer type="wms" position={4} options={{ url: '/wms', name: 'layer03' }} />
<CesiumLayer type="wms" position={1} options={{ url: '/wms', name: 'layer01', "visibility": true }} />
<CesiumLayer type="wms" position={3} options={{ url: '/wms', name: 'layer02', "visibility": true }} />
<CesiumLayer type="wms" position={4} options={{ url: '/wms', name: 'layer03', "visibility": true }} />
</CesiumMap>,
document.getElementById('container')
);
Expand All @@ -468,9 +468,9 @@ describe('CesiumMap', () => {
act(() => {
ReactDOM.render(
<CesiumMap ref={value => { ref = value; } } id="mymap" center={{ y: 43.9, x: 10.3 }} zoom={11}>
<CesiumLayer type="wms" position={1} options={{ url: '/wms', name: 'layer01' }} />
<CesiumLayer type="wms" position={3} options={{ url: '/wms', name: 'layer02' }} />
<CesiumLayer type="wms" position={2} options={{ url: '/wms', name: 'layer03' }} />
<CesiumLayer type="wms" position={1} options={{ url: '/wms', name: 'layer01', "visibility": true }} />
<CesiumLayer type="wms" position={3} options={{ url: '/wms', name: 'layer02', "visibility": true }} />
<CesiumLayer type="wms" position={2} options={{ url: '/wms', name: 'layer03', "visibility": true }} />
</CesiumMap>,
document.getElementById('container')
);
Expand Down
165 changes: 123 additions & 42 deletions web/client/configs/localConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,48 +104,129 @@
},
"staticServices": {
"default_map_backgrounds": {
"type": "backgrounds",
"title": "Default Backgrounds",
"titleMsgId": "defaultMapBackgroundsServiceTitle",
"autoload": true,
"backgrounds": [{
"type": "osm",
"title": "Open Street Map",
"name": "mapnik",
"source": "osm",
"group": "background"
}, {
"type": "tileprovider",
"title": "NASAGIBS Night 2012",
"provider": "NASAGIBS.ViirsEarthAtNight2012",
"name": "Night2012",
"source": "nasagibs",
"group": "background"
}, {
"type": "tileprovider",
"title": "OpenTopoMap",
"provider": "OpenTopoMap",
"name": "OpenTopoMap",
"source": "OpenTopoMap",
"group": "background"
}, {
"format": "image/jpeg",
"group": "background",
"name": "s2cloudless:s2cloudless",
"opacity": 1,
"title": "Sentinel 2 Cloudless",
"type": "wms",
"url": "https://1maps.geo-solutions.it/geoserver/wms",
"source": "s2cloudless",
"singleTile": false
}, {
"source": "ol",
"group": "background",
"title": "Empty Background",
"fixed": true,
"type": "empty"
}]
}
"type": "backgrounds",
"title": "Default Backgrounds",
"titleMsgId": "defaultMapBackgroundsServiceTitle",
"autoload": true,
"backgrounds": [{
"format": "image/jpeg",
"group": "background",
"name": "osm:osm_simple_light",
"opacity": 1,
"title": "OSM Simple Light",
"thumbURL": "product/assets/img/osm-simple-light.jpg",
"type": "wms",
"url": [
"https://maps1.geosolutionsgroup.com/geoserver/wms",
"https://maps2.geosolutionsgroup.com/geoserver/wms",
"https://maps3.geosolutionsgroup.com/geoserver/wms",
"https://maps4.geosolutionsgroup.com/geoserver/wms",
"https://maps5.geosolutionsgroup.com/geoserver/wms",
"https://maps6.geosolutionsgroup.com/geoserver/wms"
],
"visibility": false,
"singleTile": false,
"credits": {
"title": "OSM Simple Light | Rendering <a href=\"https://www.geo-solutions.it/\">GeoSolutions</a> | Data © <a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a> contributors, <a href=\"http://www.openstreetmap.org/copyright\">ODbL</a>"
}
}, {
"format": "image/jpeg",
"group": "background",
"name": "osm:osm_simple_dark",
"opacity": 1,
"title": "OSM Simple Dark",
"thumbURL": "product/assets/img/osm-simple-dark.jpg",
"type": "wms",
"url": [
"https://maps6.geosolutionsgroup.com/geoserver/wms",
"https://maps3.geosolutionsgroup.com/geoserver/wms",
"https://maps1.geosolutionsgroup.com/geoserver/wms",
"https://maps4.geosolutionsgroup.com/geoserver/wms",
"https://maps2.geosolutionsgroup.com/geoserver/wms",
"https://maps5.geosolutionsgroup.com/geoserver/wms"
],
"visibility": false,
"singleTile": false,
"credits": {
"title": "OSM Simple Dark | Rendering <a href=\"https://www.geo-solutions.it/\">GeoSolutions</a> | Data © <a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a> contributors, <a href=\"http://www.openstreetmap.org/copyright\">ODbL</a>"
}
}, {
"format": "image/jpeg",
"group": "background",
"name": "osm:osm",
"opacity": 1,
"title": "OSM Bright",
"thumbURL": "product/assets/img/osm-bright.jpg",
"type": "wms",
"url": [
"https://maps1.geosolutionsgroup.com/geoserver/wms",
"https://maps2.geosolutionsgroup.com/geoserver/wms",
"https://maps3.geosolutionsgroup.com/geoserver/wms",
"https://maps4.geosolutionsgroup.com/geoserver/wms",
"https://maps5.geosolutionsgroup.com/geoserver/wms",
"https://maps6.geosolutionsgroup.com/geoserver/wms"
],
"visibility": true,
"singleTile": false,
"credits": {
"title": "OSM Bright | Rendering <a href=\"https://www.geo-solutions.it/\">GeoSolutions</a> | Data © <a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a> contributors, <a href=\"http://www.openstreetmap.org/copyright\">ODbL</a>"
}
}, {
"format": "image/jpeg",
"group": "background",
"name": "ne:ne-political",
"opacity": 1,
"title": "NE Political",
"thumbURL": "product/assets/img/ne-political.jpg",
"type": "wms",
"url": [
"https://maps1.geosolutionsgroup.com/geoserver/wms",
"https://maps2.geosolutionsgroup.com/geoserver/wms",
"https://maps3.geosolutionsgroup.com/geoserver/wms",
"https://maps4.geosolutionsgroup.com/geoserver/wms",
"https://maps5.geosolutionsgroup.com/geoserver/wms",
"https://maps6.geosolutionsgroup.com/geoserver/wms"
],
"visibility": false,
"singleTile": false,
"credits": {
"title": "<p></p>\n"
}
}, {
"format": "image/jpeg",
"group": "background",
"name": "s2cloudless:s2cloudless",
"opacity": 1,
"title": "Sentinel 2 Cloudless",
"type": "wms",
"url": [
"https://maps1.geosolutionsgroup.com/geoserver/wms",
"https://maps2.geosolutionsgroup.com/geoserver/wms",
"https://maps3.geosolutionsgroup.com/geoserver/wms",
"https://maps4.geosolutionsgroup.com/geoserver/wms",
"https://maps5.geosolutionsgroup.com/geoserver/wms",
"https://maps6.geosolutionsgroup.com/geoserver/wms"
],
"source": "s2cloudless",
"singleTile": false,
"visibility": false
}, {
"type": "osm",
"title": "Open Street Map",
"name": "mapnik",
"source": "osm",
"group": "background",
"visibility": false
}, {
"source": "ol",
"group": "background",
"title": "Empty Background",
"fixed": true,
"type": "empty",
"visibility": false
}
]
}
}
}
},
Expand Down
Loading

0 comments on commit 8eacc19

Please sign in to comment.