Skip to content

Commit

Permalink
Add translations for map layers
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobesson committed Apr 4, 2019
1 parent b68eb34 commit 4dfe5b1
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 82 deletions.
4 changes: 2 additions & 2 deletions src/components/map/OlMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
<header v-translate>Base layer</header>
<div v-for="layer of mapLayers" :key="layer.title" @click="visibleLayer=layer">
<input :checked="layer==visibleLayer" type="radio">
{{ layer.get('title') }}
{{ $gettext(layer.get('title')) }}
</div>
</td>
<td>
<header v-translate>Slopes</header>
<div v-for="layer of dataLayers" :key="layer.title" @click="toogleMapLayer(layer)">
<input :checked="layer.getVisible()" type="checkbox">
{{ layer.get('title') }}
{{ $gettext(layer.get('title')) }}
</div>
</td>
<td v-if="showProtectionAreas && !editable">
Expand Down
8 changes: 8 additions & 0 deletions src/components/map/map-layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function createIgnSource(title, layer, format = 'jpeg') {
});
}

// $gettext('ESRI', 'Map layer')
const esri = new ol.layer.Tile({
title: 'Esri',
type: 'base',
Expand All @@ -83,6 +84,7 @@ var openStreetMap = new ol.layer.Tile({
visible: false,
}) */

// $gettext('Bing', 'Map layer')
const bingMap = new ol.layer.Tile({
title: 'Bing',
source: new ol.source.BingMaps({
Expand All @@ -92,6 +94,7 @@ const bingMap = new ol.layer.Tile({
visible: false
});

// $gettext('OpenTopoMap', 'Map layer')
const openTopoMap = new ol.layer.Tile({
title: 'OpenTopoMap',
type: 'base',
Expand All @@ -105,12 +108,17 @@ const openTopoMap = new ol.layer.Tile({
})
});

// $gettext('IGN maps', 'Map layer')
const ignMaps = createIgnSource('IGN maps', 'GEOGRAPHICALGRIDSYSTEMS.MAPS');
// $gettext('IGN ortho', 'Map layer')
const ignOrtho = createIgnSource('IGN ortho', 'ORTHOIMAGERY.ORTHOPHOTOS');
// $gettext('SwissTopo', 'Map layer')
const swissTopo = createSwisstopoLayer('SwissTopo', 'ch.swisstopo.pixelkarte-farbe');

// $gettext('IGN', 'Map slopes layer')
const ignSlopes = createIgnSource('IGN', 'GEOGRAPHICALGRIDSYSTEMS.SLOPES.MOUNTAIN', 'png');
ignSlopes.setOpacity(0.4);
// $gettext('SwissTopo', 'Map slopes layer')
const swissSlopes = createSwisstopoLayer('SwissTopo', 'ch.swisstopo.hangneigung-ueber_30', 'png', '20160101');
swissSlopes.setOpacity(0.4);

Expand Down
Loading

0 comments on commit 4dfe5b1

Please sign in to comment.