Skip to content

Commit

Permalink
Merge branch 'devel' and bump version to 1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
tmuguet committed Dec 12, 2017
2 parents b6a1547 + 29134dc commit 888911b
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 27 deletions.
18 changes: 9 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
<html lang="fr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, user-scalable=no">
<meta name="author" content="Thomas Muguet">

<title>map2gpx by tmuguet</title>
<link rel="shortcut icon" href="ico/logo.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="ico/logo-144.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="ico/logo-114.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="ico/logo-medium-72.png">
<link rel="apple-touch-icon-precomposed" href="ico/logo-medium-57.png">
<link rel="apple-touch-icon" sizes="144x144" href="ico/logo-144.png">
<link rel="apple-touch-icon" sizes="114x114" href="ico/logo-114.png">
<link rel="apple-touch-icon" sizes="72x72" href="ico/logo-medium-72.png">
<link rel="apple-touch-icon" sizes="57x57" href="ico/logo-medium-57.png">

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

Expand Down Expand Up @@ -82,7 +82,7 @@

<link rel="stylesheet" href="leaflet/GpPluginLeaflet.css" />
<script data-key="jwwl8p4ie5qcwbgohl0uv7zx" src="leaflet/GpPluginLeaflet.js"></script>
<script type="text/javascript">
<script>
var keyIgn = 'jwwl8p4ie5qcwbgohl0uv7zx';
</script>

Expand Down Expand Up @@ -217,13 +217,13 @@ <h2><i class="fa fa-exclamation-triangle fa-3x" aria-hidden="true"></i><br/>Trac
<div id="data-computing" class="data"></div>
<div id="loading" style="display: block; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; background-color: #FFFFFF; z-index: 5000; text-align: center;">
<h2><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i><br/><span>Chargement en cours...</span></h2>
<h3></h3>
<h3>&nbsp;</h3>
</div>
<div id="pending">
<h2><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i><br/><span>Calcul de l'itinéraire en cours...</span></h2>
<h3></h3>
<h3>&nbsp;</h3>
</div>
<div id="mobile-warning"><strong>Attention:</strong> ce site n'est pas destiné aux mobiles. <button>Ok, j'ai compris</button></div>
<div id="mobile-warning"><strong>Attention:</strong> ce site n'est pas destiné aux mobiles car il peut consommer beaucoup de données. Le site reste cependant fonctionnel.<button>Ok, j'ai compris</button></div>

<script src="js/map2gpx.min.js"></script>
</body>
Expand Down
19 changes: 14 additions & 5 deletions js/map2gpx.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2250,6 +2250,7 @@ L.Layer.include({
},
layerSwitcher: {
show: true,
showAll: true,
leafletOptions: {
collapsed: false
}
Expand Down Expand Up @@ -2307,7 +2308,7 @@ L.Layer.include({
this._initializeTraceButtons();
this._initializeExportButtons();
this._initializeImportButtons();
this._initializeHelpButtons();
if (this.options.controls.help.show) this._initializeHelpButtons();

this._trigger('created', null, {});
this._trigger('statechanged', null, this._buildEventData());
Expand All @@ -2326,9 +2327,11 @@ L.Layer.include({
layer: 'ORTHOIMAGERY.ORTHOPHOTOS',
apiKey: keyIgn
}).addTo(this.map);
this.layers.promises.push($.Deferred(function () {
_this.layers.photos.once('load', this.resolve);
}));
if (this.options.controls.layerSwitcher.showAll) {
this.layers.promises.push($.Deferred(function () {
_this.layers.photos.once('load', this.resolve);
}));
}

// Don't monitor load event, because we don't display this layer (thus, never fires)
this.layers.slopes = L.geoportalLayer.WMTS({
Expand All @@ -2342,7 +2345,7 @@ L.Layer.include({
layer: 'GEOGRAPHICALGRIDSYSTEMS.MAPS',
apiKey: keyIgn
}, {
opacity: 0.25
opacity: this.options.controls.layerSwitcher.showAll ? 0.25 : 1
}).addTo(this.map);
this.layers.promises.push($.Deferred(function () {
_this.layers.maps.once('load', this.resolve);
Expand Down Expand Up @@ -2408,7 +2411,12 @@ L.Layer.include({
_initializeLayerSwitcher: function _initializeLayerSwitcher() {
var layerSwitcher = L.geoportalControl.LayerSwitcher(this.options.controls.layerSwitcher.leafletOptions);
this.map.addControl(layerSwitcher);

layerSwitcher.setVisibility(this.layers.slopes, false);
if (!this.options.controls.layerSwitcher.showAll) {
layerSwitcher.setVisibility(this.layers.photos, false);
}

$('.GPlayerRemove').remove();
},

Expand Down Expand Up @@ -2739,6 +2747,7 @@ window.onload = function () {
show: !isSmallScreen
},
layerSwitcher: {
showAll: !isSmallScreen,
leafletOptions: {
collapsed: isSmallScreen
}
Expand Down
2 changes: 1 addition & 1 deletion js/map2gpx.min.js

Large diffs are not rendered by default.

20 changes: 15 additions & 5 deletions js/map2gpx.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -2316,6 +2316,7 @@ L.Layer.include({
},
layerSwitcher: {
show: true,
showAll: true,
leafletOptions: {
collapsed: false,
},
Expand Down Expand Up @@ -2373,7 +2374,8 @@ L.Layer.include({
this._initializeTraceButtons();
this._initializeExportButtons();
this._initializeImportButtons();
this._initializeHelpButtons();
if (this.options.controls.help.show)
this._initializeHelpButtons();

this._trigger('created', null, {});
this._trigger('statechanged', null, this._buildEventData());
Expand All @@ -2390,9 +2392,11 @@ L.Layer.include({
layer: 'ORTHOIMAGERY.ORTHOPHOTOS',
apiKey: keyIgn,
}).addTo(this.map);
this.layers.promises.push($.Deferred(function () {
_this.layers.photos.once('load', this.resolve);
}));
if (this.options.controls.layerSwitcher.showAll) {
this.layers.promises.push($.Deferred(function () {
_this.layers.photos.once('load', this.resolve);
}));
}

// Don't monitor load event, because we don't display this layer (thus, never fires)
this.layers.slopes = L.geoportalLayer.WMTS({
Expand All @@ -2406,7 +2410,7 @@ L.Layer.include({
layer: 'GEOGRAPHICALGRIDSYSTEMS.MAPS',
apiKey: keyIgn,
}, {
opacity: 0.25,
opacity: this.options.controls.layerSwitcher.showAll ? 0.25 : 1,
}).addTo(this.map);
this.layers.promises.push($.Deferred(function () {
_this.layers.maps.once('load', this.resolve);
Expand Down Expand Up @@ -2472,7 +2476,12 @@ L.Layer.include({
_initializeLayerSwitcher: function () {
let layerSwitcher = L.geoportalControl.LayerSwitcher(this.options.controls.layerSwitcher.leafletOptions);
this.map.addControl(layerSwitcher);

layerSwitcher.setVisibility(this.layers.slopes, false);
if (!this.options.controls.layerSwitcher.showAll) {
layerSwitcher.setVisibility(this.layers.photos, false);
}

$('.GPlayerRemove').remove();
},

Expand Down Expand Up @@ -2794,6 +2803,7 @@ window.onload = function () {
show: !isSmallScreen,
},
layerSwitcher: {
showAll: !isSmallScreen,
leafletOptions: {
collapsed: isSmallScreen,
},
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "map2gpx",
"version": "1.3.2",
"version": "1.3.3",
"description": "map2gpx is a web application that lets you trace paths on maps (for hiking for instance) and export them to GPX or KML formats.\\n",
"main": "n/a",
"private": true,
Expand Down
19 changes: 14 additions & 5 deletions src/js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
layerSwitcher: {
show: true,
showAll: true,
leafletOptions: {
collapsed: false,
},
Expand Down Expand Up @@ -77,7 +78,8 @@
this._initializeTraceButtons();
this._initializeExportButtons();
this._initializeImportButtons();
this._initializeHelpButtons();
if (this.options.controls.help.show)
this._initializeHelpButtons();

this._trigger('created', null, {});
this._trigger('statechanged', null, this._buildEventData());
Expand All @@ -94,9 +96,11 @@
layer: 'ORTHOIMAGERY.ORTHOPHOTOS',
apiKey: keyIgn,
}).addTo(this.map);
this.layers.promises.push($.Deferred(function () {
_this.layers.photos.once('load', this.resolve);
}));
if (this.options.controls.layerSwitcher.showAll) {
this.layers.promises.push($.Deferred(function () {
_this.layers.photos.once('load', this.resolve);
}));
}

// Don't monitor load event, because we don't display this layer (thus, never fires)
this.layers.slopes = L.geoportalLayer.WMTS({
Expand All @@ -110,7 +114,7 @@
layer: 'GEOGRAPHICALGRIDSYSTEMS.MAPS',
apiKey: keyIgn,
}, {
opacity: 0.25,
opacity: this.options.controls.layerSwitcher.showAll ? 0.25 : 1,
}).addTo(this.map);
this.layers.promises.push($.Deferred(function () {
_this.layers.maps.once('load', this.resolve);
Expand Down Expand Up @@ -176,7 +180,12 @@
_initializeLayerSwitcher: function () {
let layerSwitcher = L.geoportalControl.LayerSwitcher(this.options.controls.layerSwitcher.leafletOptions);
this.map.addControl(layerSwitcher);

layerSwitcher.setVisibility(this.layers.slopes, false);
if (!this.options.controls.layerSwitcher.showAll) {
layerSwitcher.setVisibility(this.layers.photos, false);
}

$('.GPlayerRemove').remove();
},

Expand Down
1 change: 1 addition & 0 deletions src/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ window.onload = function () {
show: !isSmallScreen,
},
layerSwitcher: {
showAll: !isSmallScreen,
leafletOptions: {
collapsed: isSmallScreen,
},
Expand Down

0 comments on commit 888911b

Please sign in to comment.