Skip to content

Commit

Permalink
Run code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Continuous integration committed Jul 15, 2021
1 parent 3a877c1 commit 868d5c7
Show file tree
Hide file tree
Showing 7 changed files with 480 additions and 493 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.min.js
2 changes: 2 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bracketSpacing: false
quoteProps: preserve
1 change: 0 additions & 1 deletion CONST_create_template/.github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ jobs:
run: c2cciutils-publish --group=config
- run: ci/trigger --image=config


geoportal:
runs-on: ubuntu-20.04
name: Geoportal
Expand Down
7 changes: 2 additions & 5 deletions CONST_create_template/geoportal/vars.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---

extends: CONST_vars.yaml

vars:

srid: 2056

alternate_projections: &alternate_projections
Expand Down Expand Up @@ -140,7 +138,7 @@ vars:
# Default values for the admin interface's maps.
map:
baseLayers:
- type_: "OSM"
- type_: 'OSM'
view:
projection: 'EPSG:3857'
center: [829170, 5933942]
Expand All @@ -167,7 +165,7 @@ vars:
shortener:
# Used to send a confirmation email
email_from: [email protected]
email_subject: "Geoportal URL"
email_subject: 'Geoportal URL'
email_body: |
Hello,
Expand Down Expand Up @@ -322,7 +320,6 @@ no_interpreted:
- reset_password.email_body
- shortener.email_body
- welcome_email.email_body

# Standalone version
# runtime_postprocess:
# - expression: "int({})"
Expand Down
260 changes: 129 additions & 131 deletions geoportal/geomapfish_geoportal/static/story-map.html
Original file line number Diff line number Diff line change
@@ -1,142 +1,140 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>ngeo story map</title>

<head>
<meta charset='utf-8'>
<title>ngeo story map</title>
<link href="https://geomapfish-demo-2-5.camptocamp.com/api.css" rel="stylesheet" />
<script src="https://geomapfish-demo-2-5.camptocamp.com/api.js?version=2"></script>

<link href="https://geomapfish-demo-2-5.camptocamp.com/api.css" rel="stylesheet">
<script src="https://geomapfish-demo-2-5.camptocamp.com/api.js?version=2"></script>
<script src="https://openlayers.org/en/v6.1.1/build/ol.js"></script>

<script src="https://openlayers.org/en/v6.1.1/build/ol.js"></script>
<link href="https://viglino.github.io/ol-ext/dist/ol-ext.css" rel="stylesheet" />
<script src="https://viglino.github.io/ol-ext/dist/ol-ext.js"></script>

<link href="https://viglino.github.io/ol-ext/dist/ol-ext.css" rel="stylesheet">
<script src="https://viglino.github.io/ol-ext/dist/ol-ext.js"></script>

<style>
#map {
width: 600px;
height: 600px;
display: inline-block;
}

#story {
width: 800px;
height: 600px;
display: inline-block;
}
</style>

</head>

<body>

<div id="map"></div>

<div id="story">
<div class="chapter select" name="start">
<h2>story map</h2>
<p>A story map with ngeo.</p>
<div class="ol-scroll-next"><span>Start</span></div>
</div>

<div class="chapter" name="Nyon">
<h2>Nyon</h2>
<img src="https://upload.wikimedia.org/wikipedia/commons/9/9b/Nyon_nma.jpg">
<p>
Nyon est une ville et une commune suisse du canton de Vaud, située dans le district de Nyon, dont elle est le
chef-lieu.
</p>
</div>
<div class="chapter" name="Morges">
<h2>Morges</h2>
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/BAM01wiki.jpg/640px-BAM01wiki.jpg">
<p>
Morges est une commune suisse du canton de Vaud, située au bord du Léman. La ville est le
chef-lieu du district de Morges, qui se trouve être la limite occidentale de l'agglomération lausannoise, aussi
nommée agglomération Lausanne-Morges.
</p>
</div>
<div class="chapter" name="Lausanne">
<h2>Lausanne</h2>
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Duomo_di_losanna%2C_int.%2C_salita_alla_torre%2C_veduta_sulla_citt%C3%A0_08.JPG/640px-Duomo_di_losanna%2C_int.%2C_salita_alla_torre%2C_veduta_sulla_citt%C3%A0_08.JPG">
<p>
Lausanne est une ville suisse située sur la rive nord du lac Léman. Elle est la capitale et ville principale du
canton de Vaud et le chef-lieu du district de Lausanne. Elle constitue la quatrième ville du pays en termes de
population4 après Zurich, Genève et Bâle.
</p>
</div>
<div class="chapter" name="Vevey">
<h2>Vevey</h2>
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/5f/P1280110_-_Vevey.JPG/534px-P1280110_-_Vevey.JPG">
<p>
Vevey est une ville et une commune suisse du canton de Vaud située sur la rive nord du lac Léman. Sixième
commune du canton par sa population, elle est le chef-lieu du district de la Riviera-Pays-d'Enhaut. Au 31
décembre 2018, la commune de Vevey compte 19 904 habitants.
</p>
</div>
</div>

<p>Go to <a href="#" onclick="story.setChapter('Lausanne');">Lausanne chapter</a></p>

<script>
// mapping of chapter name to position
var positions = {
// the initial position of the map
start: {
center: [2544500, 1210100],
zoom: 0,
},
Nyon: {
center: [2507794, 1137450],
zoom: 8
},
Morges: {
center: [2527497, 1151530],
zoom: 4
},
Lausanne: {
center: [2537882, 1152065],
zoom: 3
},
Vevey: {
center: [2554182, 1145558],
zoom: 8
<style>
#map {
width: 600px;
height: 600px;
display: inline-block;
}
};

// create a ngeo API instance.
var ngeoApi = new geomapfish.Map({
div: 'map'
});

var map = ngeoApi.getMap();

var storyContainer = document.getElementById('story');

var story = new ol.control.Storymap({
target: storyContainer
});

story.on('scrollto', function (event) {
// unselect previous div
storyContainer.querySelector('.chapter.select').classList.remove('select');
// select current div
event.element.classList.add('select');

// recenter to position
var position = positions[event.name];
if (position) {
ngeoApi.recenter(position.center, position.zoom);
#story {
width: 800px;
height: 600px;
display: inline-block;
}
});

map.addControl(story);

</script>

</body>
</style>
</head>

<body>
<div id="map"></div>

<div id="story">
<div class="chapter select" name="start">
<h2>story map</h2>
<p>A story map with ngeo.</p>
<div class="ol-scroll-next"><span>Start</span></div>
</div>

<div class="chapter" name="Nyon">
<h2>Nyon</h2>
<img src="https://upload.wikimedia.org/wikipedia/commons/9/9b/Nyon_nma.jpg" />
<p>
Nyon est une ville et une commune suisse du canton de Vaud, située dans le district de Nyon, dont
elle est le chef-lieu.
</p>
</div>
<div class="chapter" name="Morges">
<h2>Morges</h2>
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/BAM01wiki.jpg/640px-BAM01wiki.jpg"
/>
<p>
Morges est une commune suisse du canton de Vaud, située au bord du Léman. La ville est le chef-lieu
du district de Morges, qui se trouve être la limite occidentale de l'agglomération lausannoise,
aussi nommée agglomération Lausanne-Morges.
</p>
</div>
<div class="chapter" name="Lausanne">
<h2>Lausanne</h2>
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Duomo_di_losanna%2C_int.%2C_salita_alla_torre%2C_veduta_sulla_citt%C3%A0_08.JPG/640px-Duomo_di_losanna%2C_int.%2C_salita_alla_torre%2C_veduta_sulla_citt%C3%A0_08.JPG"
/>
<p>
Lausanne est une ville suisse située sur la rive nord du lac Léman. Elle est la capitale et ville
principale du canton de Vaud et le chef-lieu du district de Lausanne. Elle constitue la quatrième
ville du pays en termes de population4 après Zurich, Genève et Bâle.
</p>
</div>
<div class="chapter" name="Vevey">
<h2>Vevey</h2>
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/5f/P1280110_-_Vevey.JPG/534px-P1280110_-_Vevey.JPG"
/>
<p>
Vevey est une ville et une commune suisse du canton de Vaud située sur la rive nord du lac Léman.
Sixième commune du canton par sa population, elle est le chef-lieu du district de la
Riviera-Pays-d'Enhaut. Au 31 décembre 2018, la commune de Vevey compte 19 904 habitants.
</p>
</div>
</div>

<p>Go to <a href="#" onclick="story.setChapter('Lausanne');">Lausanne chapter</a></p>

<script>
// mapping of chapter name to position
var positions = {
// the initial position of the map
start: {
center: [2544500, 1210100],
zoom: 0,
},
Nyon: {
center: [2507794, 1137450],
zoom: 8,
},
Morges: {
center: [2527497, 1151530],
zoom: 4,
},
Lausanne: {
center: [2537882, 1152065],
zoom: 3,
},
Vevey: {
center: [2554182, 1145558],
zoom: 8,
},
};

// create a ngeo API instance.
var ngeoApi = new geomapfish.Map({
div: 'map',
});

var map = ngeoApi.getMap();

var storyContainer = document.getElementById('story');

var story = new ol.control.Storymap({
target: storyContainer,
});

story.on('scrollto', function (event) {
// unselect previous div
storyContainer.querySelector('.chapter.select').classList.remove('select');
// select current div
event.element.classList.add('select');

// recenter to position
var position = positions[event.name];
if (position) {
ngeoApi.recenter(position.center, position.zoom);
}
});

map.addControl(story);
</script>
</body>
</html>
Loading

0 comments on commit 868d5c7

Please sign in to comment.