Skip to content

Commit

Permalink
Fixes #2547: upgraded openlayers to 4.6.4 (#2646)
Browse files Browse the repository at this point in the history
* Fixes #2547: upgraded openlayers to 4.6.4

* Fix for tests
  • Loading branch information
mbarto authored Feb 28, 2018
1 parent d54c857 commit 225e8c0
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"moment": "2.13.0",
"object-assign": "4.1.1",
"ogc-schemas": "2.6.1",
"openlayers": "4.0.1",
"openlayers": "4.6.4",
"pdfviewer": "0.3.2",
"proj4": "https://github.com/geosolutions-it/proj4js/tarball/mapstore2_fixes",
"prop-types": "15.6.0",
Expand Down
4 changes: 2 additions & 2 deletions project/custom/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<title>__PROJECTDESCRIPTION__</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.2.4/leaflet.draw.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/mapstore2.css">
<script src="https://maps.google.com/maps/api/js?v=3"></script>
<!--script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.10/proj4.js"></script-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.2.4/leaflet.draw.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.js"></script>
<script src="https://cesiumjs.org/releases/1.17/Build/Cesium/Cesium.js"></script>
<link rel="stylesheet" href="https://cesiumjs.org/releases/1.17/Build/Cesium/Widgets/widgets.css" />
<script src="libs/cesium-navigation/cesium-navigation.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions project/standard/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<title>__PROJECTDESCRIPTION__</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.2.4/leaflet.draw.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://maps.google.com/maps/api/js?v=3"></script>
<!--script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.10/proj4.js"></script-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.2.4/leaflet.draw.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.js"></script>
<script src="https://cesiumjs.org/releases/1.17/Build/Cesium/Cesium.js"></script>
<link rel="stylesheet" href="https://cesiumjs.org/releases/1.17/Build/Cesium/Widgets/widgets.css" />
<script src="MapStore2/web/client/libs/cesium-navigation/cesium-navigation.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('test Layer Properties General module component', () => {
expect(comp).toExist();
const inputs = ReactTestUtils.scryRenderedDOMComponentsWithTag( comp, "input" );
expect(inputs).toExist();
expect(inputs.length).toBe(9);
expect(inputs.length).toBe(10);

});
it('tests Layer Properties Display component events', () => {
Expand All @@ -69,7 +69,7 @@ describe('test Layer Properties General module component', () => {
expect(comp).toExist();
const inputs = ReactTestUtils.scryRenderedDOMComponentsWithTag( comp, "input" );
expect(inputs).toExist();
expect(inputs.length).toBe(9);
expect(inputs.length).toBe(10);
ReactTestUtils.Simulate.change(inputs[0]);
expect(spy.calls.length).toBe(1);
});
Expand Down
8 changes: 4 additions & 4 deletions web/client/components/map/openlayers/__tests__/Map-test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,6 @@ describe('OpenlayersMap', () => {
, document.getElementById("map"));

const olMap = map.map;
olMap.getView().setZoom(12);

olMap.on('moveend', () => {
// The first call is triggered as soon as the map component is mounted, the second one is as a result of setZoom
expect(spy.calls.length).toEqual(2);
Expand All @@ -290,6 +288,8 @@ describe('OpenlayersMap', () => {
expect(spy.calls[1].arguments[3].width).toExist();
done();
});
olMap.getView().setZoom(12);
olMap.dispatchEvent('moveend');
});

it('check if the handler for "moveend" event is called after setCenter', (done) => {
Expand All @@ -307,8 +307,6 @@ describe('OpenlayersMap', () => {
, document.getElementById("map"));

const olMap = map.map;
olMap.getView().setCenter(ol.proj.transform([10, 44], 'EPSG:4326', 'EPSG:3857'));

olMap.on('moveend', () => {
// The first call is triggered as soon as the map component is mounted, the second one is as a result of setCenter
expect(spy.calls.length).toEqual(2);
Expand All @@ -322,6 +320,8 @@ describe('OpenlayersMap', () => {
expect(spy.calls[1].arguments[3].width).toExist();
done();
});
olMap.getView().setCenter(ol.proj.transform([10, 44], 'EPSG:4326', 'EPSG:3857'));
olMap.dispatchEvent('moveend');
});

it('check if the map changes when receive new props', () => {
Expand Down
4 changes: 2 additions & 2 deletions web/client/epics/__tests__/localconfig-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ describe('localconfig Epics', () => {
const suppLocales = LocaleUtils.getSupportedLocales();
switch (action.type) {
case SUPPORTED_LOCALES_REGISTERED:
// 6 is the actual default number of locales
expect(Object.keys(suppLocales).length).toBe(6);
// 7 is the actual default number of locales
expect(Object.keys(suppLocales).length).toBe(7);
break;
default:
expect(true).toBe(false);
Expand Down
4 changes: 2 additions & 2 deletions web/client/examples/api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway" type='text/css'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
<link rel="stylesheet" href="https://rawgit.com/Leaflet/Leaflet.draw/v0.2.4/dist/leaflet.draw.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/styles/shCore.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/styles/shThemeDefault.min.css">
Expand All @@ -18,7 +18,7 @@
<!--script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.10/proj4.js"></script-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
<script src="https://rawgit.com/Leaflet/Leaflet.draw/v0.2.4/dist/leaflet.draw.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.js"></script>
<script src="https://cesiumjs.org/releases/1.17/Build/Cesium/Cesium.js"></script>
<link rel="stylesheet" href="https://cesiumjs.org/releases/1.17/Build/Cesium/Widgets/widgets.css" />
<style>
Expand Down
4 changes: 2 additions & 2 deletions web/client/examples/plugins/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway" type='text/css'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
<link rel="stylesheet" href="https://rawgit.com/Leaflet/Leaflet.draw/v0.2.4/dist/leaflet.draw.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.css" />
<script src="https://maps.google.com/maps/api/js?v=3"></script>
<!--script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.10/proj4.js"></script-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
<script src="https://rawgit.com/Leaflet/Leaflet.draw/v0.2.4/dist/leaflet.draw.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.js"></script>
<script src="https://cesiumjs.org/releases/1.17/Build/Cesium/Cesium.js"></script>
<link rel="stylesheet" href="https://cesiumjs.org/releases/1.17/Build/Cesium/Widgets/widgets.css" />
<style id="custom_theme"></style>
Expand Down
4 changes: 2 additions & 2 deletions web/client/examples/queryform/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>QueryForm</title>
<link rel="stylesheet" href="https://rawgit.com/Leaflet/Leaflet.draw/v0.2.4/dist/leaflet.draw.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
<!--script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.12/proj4.js"></script-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.js"></script>
<script src="https://rawgit.com/Leaflet/Leaflet.draw/v0.2.4/dist/leaflet.draw.js"></script>
<style>
html, body, #container {
Expand Down
4 changes: 2 additions & 2 deletions web/client/examples/rasterstyler/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<title>Raster Styler</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
<link rel="stylesheet" href="https://rawgit.com/Leaflet/Leaflet.draw/v0.2.4/dist/leaflet.draw.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://maps.google.com/maps/api/js?v=3"></script>
<!--script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.10/proj4.js"></script-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
<script src="https://rawgit.com/Leaflet/Leaflet.draw/v0.2.4/dist/leaflet.draw.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.js"></script>
<script src="https://unpkg.com/[email protected]/build/pdf.combined.js"></script>
</head>
<body class="ms2">
Expand Down
4 changes: 2 additions & 2 deletions web/client/examples/styler/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway" type='text/css'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
<link rel="stylesheet" href="https://rawgit.com/Leaflet/Leaflet.draw/v0.2.4/dist/leaflet.draw.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://rawgit.com/geosolutions-it/MapStore2-theme/master/theme/default/css/css.css">
<link rel="stylesheet" href="https://rawgit.com/geosolutions-it/MapStore2-theme/master/theme/default/css/ms2-theme.css">
<link rel="stylesheet" href="https://rawgit.com/geosolutions-it/MapStore2-theme/master/theme/default/css/font.css">
<script src="https://maps.google.com/maps/api/js?v=3"></script>
<!--script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.10/proj4.js"></script-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.js"></script>
</head>
<body className="themed ms2">
<div id="container"></div>
Expand Down
4 changes: 2 additions & 2 deletions web/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.2.4/leaflet.draw.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.css" />
<link rel="shortcut icon" type="image/png" href="https://cdn.jslibs.mapstore2.geo-solutions.it/leaflet/favicon.ico" />
<script src="https://maps.google.com/maps/api/js?v=3"></script>
<!--script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.10/proj4.js"></script-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.2.4/leaflet.draw.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.js"></script>
<!--<script src="https://www.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=__API_KEY_MAPQUEST__"></script>-->
<script src="https://cesiumjs.org/releases/1.17/Build/Cesium/Cesium.js"></script>
<link rel="stylesheet" href="https://cesiumjs.org/releases/1.17/Build/Cesium/Widgets/widgets.css" />
Expand Down
4 changes: 2 additions & 2 deletions web/client/indexTemplate.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.2.4/leaflet.draw.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.css" />
<link rel="shortcut icon" type="image/png" href="https://cdn.jslibs.mapstore2.geo-solutions.it/leaflet/favicon.ico" />
<script src="https://maps.google.com/maps/api/js?v=3"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.10/proj4.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.2.4/leaflet.draw.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.js"></script>
<script src="https://cesiumjs.org/releases/1.17/Build/Cesium/Cesium.js"></script>
<link rel="stylesheet" href="https://cesiumjs.org/releases/1.17/Build/Cesium/Widgets/widgets.css" />
<script src="libs/cesium-navigation/cesium-navigation.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions web/client/simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<title>MapStore 2 HomePage</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.css" />
<link rel="stylesheet" href="https://rawgit.com/Leaflet/Leaflet.draw/v0.2.4/dist/leaflet.draw.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://maps.google.com/maps/api/js?v=3"></script>
<!--script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.10/proj4.js"></script-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.js"></script>
<script src="https://rawgit.com/Leaflet/Leaflet.draw/v0.2.4/dist/leaflet.draw.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.4/ol.js"></script>
</head>
<body>
<div id="container"></div>
Expand Down
4 changes: 2 additions & 2 deletions web/client/utils/LocaleUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ let supportedLocales = {
"zh": {
code: "zh-ZH",
description: "中文"
}/*,
},
"nl": {
code: "nl-NL",
description: "Nederlands"
}*/
}
};
const DATE_FORMATS = {
"default": "yyyy/MM/dd",
Expand Down

0 comments on commit 225e8c0

Please sign in to comment.