-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4913 from camptocamp/merge_in_2.3
Merge 2.3 into 2.4
- Loading branch information
Showing
36 changed files
with
2,648 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#map { | ||
width: 600px; | ||
height: 400px; | ||
position: relative; | ||
} | ||
ngeo-offline div { | ||
z-index: 1; | ||
} | ||
ngeo-offline .main-button { | ||
position: absolute; | ||
right: 1rem; | ||
bottom: 5rem; | ||
cursor: pointer; | ||
} | ||
ngeo-offline .main-button .no-data { | ||
color: black; | ||
} | ||
ngeo-offline .main-button .with-data { | ||
color: red; | ||
} | ||
ngeo-offline .main-button .no-data, | ||
ngeo-offline .main-button .with-data { | ||
background-color: white; | ||
text-align: center; | ||
font-size: 2.5rem; | ||
line-height: 2rem; | ||
border-radius: 2rem; | ||
font-family: FontAwesome; | ||
} | ||
|
||
ngeo-offline .validate-extent { | ||
position: absolute; | ||
bottom: 0.5rem; | ||
width: 10rem; | ||
left: calc(50% - 5rem); | ||
} | ||
ngeo-offline .in-progress { | ||
position: absolute; | ||
left: calc(50% - 3.3rem); | ||
top: calc(50% - 3rem); | ||
color: white; | ||
font-weight: bold; | ||
background-color: #337ab7; | ||
padding: 2rem 2rem; | ||
border-radius: 1rem; | ||
} | ||
ngeo-offline .modal-content { | ||
width: 30rem; | ||
} | ||
ngeo-offline .modal-body button { | ||
display: block; | ||
margin: 0.5rem auto; | ||
width: 25rem; | ||
} | ||
.offline-msg { | ||
display: none; | ||
} | ||
.offline .offline-msg { | ||
display: block; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html ng-app='app'> | ||
<head> | ||
<title>Offline example</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" | ||
content="initial-scale=1.0, user-scalable=no, width=device-width"> | ||
<meta name="mobile-web-app-capable" content="yes"> | ||
</head> | ||
<body ng-controller="MainController as ctrl" ng-class="{offline: ctrl.ngeoNetworkStatus.isDisconnected()}"> | ||
<div class="offline-msg alert-danger" translate>You are currently offline.</div> | ||
<div id="map" ngeo-map="ctrl.map"> | ||
<ngeo-offline | ||
ngeo-offline-map="ctrl.map" | ||
ngeo-offline-extentsize="ctrl.offlineExtentSize"> | ||
</ngeo-offline> | ||
</div> | ||
<p id="desc">This example shows how to use the <code><a href="../apidoc/ngeo.offline.component.html" title="Read our documentation">ngeo-offline</a></code> component.</p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/** | ||
* @module app.offline | ||
*/ | ||
const exports = {}; | ||
|
||
import '@fortawesome/fontawesome-free/css/fontawesome.min.css'; | ||
import './offline.css'; | ||
import './common_dependencies.js'; | ||
import olMap from 'ol/Map.js'; | ||
|
||
import olView from 'ol/View.js'; | ||
import olLayerTile from 'ol/layer/Tile.js'; | ||
import olSourceOSM from 'ol/source/OSM.js'; | ||
import ngeoMapModule from 'ngeo/map/module.js'; | ||
import ngeoOfflineModule from 'ngeo/offline/module.js'; | ||
import ngeoOfflineConfiguration from 'ngeo/offline/Configuration.js'; | ||
import NgeoOfflineServiceManager from 'ngeo/offline/ServiceManager.js'; | ||
import angular from 'angular'; | ||
|
||
|
||
/** @type {!angular.IModule} **/ | ||
exports.module = angular.module('app', [ | ||
'gettext', | ||
ngeoMapModule.name, | ||
ngeoOfflineModule.name, | ||
NgeoOfflineServiceManager.module.name, | ||
]); | ||
|
||
exports.module.value('ngeoOfflineTestUrl', '../../src/offline/component.html'); | ||
|
||
// Define the offline download configuration service | ||
ngeoOfflineModule.service('ngeoOfflineConfiguration', ngeoOfflineConfiguration); | ||
|
||
class MainController { | ||
|
||
/** | ||
* @param {import("ngeo/map/FeatureOverlayMgr.js").FeatureOverlayMgr} ngeoFeatureOverlayMgr | ||
* ngeo feature overlay manager service. | ||
* @param {import("ngeo/offline/NetworkStatus.js").default} ngeoNetworkStatus ngeo network status service. | ||
* @param {NgeoOfflineServiceManager} ngeoOfflineServiceManager ngeo offline service. | ||
* @ngInject | ||
*/ | ||
constructor(ngeoFeatureOverlayMgr, ngeoNetworkStatus, ngeoOfflineServiceManager) { | ||
|
||
/** | ||
* Save a square of 10 km sideways (Map's unit is the meter). | ||
* @type {number} | ||
* @export | ||
*/ | ||
this.offlineExtentSize = 10000; | ||
|
||
/** | ||
* @type {ngeoNetworkStatus} | ||
* @export | ||
*/ | ||
this.ngeoNetworkStatus = ngeoNetworkStatus; | ||
|
||
/** | ||
* @type {olMap} | ||
* @export | ||
*/ | ||
this.map = new olMap({ | ||
layers: [ | ||
new olLayerTile({ | ||
source: new olSourceOSM() | ||
}) | ||
], | ||
view: new olView({ | ||
center: [352379, 5172733], | ||
zoom: 4 | ||
}) | ||
}); | ||
|
||
ngeoFeatureOverlayMgr.init(this.map); | ||
|
||
ngeoOfflineServiceManager.setSaveService('offlineDownloader'); | ||
ngeoOfflineServiceManager.setRestoreService('ngeoOfflineRestorer'); | ||
} | ||
} | ||
|
||
|
||
exports.module.controller('MainController', MainController); | ||
|
||
|
||
export default exports; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.