Compare commits

..

2 Commits

Author SHA1 Message Date
c45f002f82
tweak trains and trainlines displayed zoom (#412) 2024-11-11 19:51:31 +01:00
e1c9bdb8bd
Show layer selector only if more that one layer (#411)
Co-authored-by: Pierre-Yves Rollo <dev@pyrollo.com>
2024-11-11 19:50:45 +01:00
5 changed files with 11 additions and 10 deletions

7
go.mod
View File

@ -7,7 +7,7 @@ require (
github.com/lib/pq v1.10.9 github.com/lib/pq v1.10.9
github.com/minetest-go/areasparser v1.0.5 github.com/minetest-go/areasparser v1.0.5
github.com/minetest-go/colormapping v1.0.5 github.com/minetest-go/colormapping v1.0.5
github.com/minetest-go/mapparser v1.0.4 github.com/minetest-go/mapparser v0.1.9
github.com/patrickmn/go-cache v2.1.0+incompatible github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/prometheus/client_golang v1.19.1 github.com/prometheus/client_golang v1.19.1
github.com/sirupsen/logrus v1.9.3 github.com/sirupsen/logrus v1.9.3
@ -28,7 +28,6 @@ require (
github.com/kr/text v0.2.0 // indirect github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-sqlite3 v1.14.16 // indirect github.com/mattn/go-sqlite3 v1.14.16 // indirect
github.com/minetest-go/types v1.0.7 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect
@ -48,6 +47,6 @@ require (
modernc.org/token v1.1.0 // indirect modernc.org/token v1.1.0 // indirect
) )
go 1.22.4 go 1.22
toolchain go1.23.0 toolchain go1.22.4

4
go.sum
View File

@ -59,10 +59,6 @@ github.com/minetest-go/colormapping v1.0.5 h1:axZm0xbOz0RQEIFvZmbxr3kuvebYiG0AAA
github.com/minetest-go/colormapping v1.0.5/go.mod h1:6UVusIQTqfWbcru5HTktWwB2BCNHUE3W0VkkRBaMfcw= github.com/minetest-go/colormapping v1.0.5/go.mod h1:6UVusIQTqfWbcru5HTktWwB2BCNHUE3W0VkkRBaMfcw=
github.com/minetest-go/mapparser v0.1.9 h1:mGjRwA2twJRyzSrYuJWvyNpEkO469K/Qun327v8rhwE= github.com/minetest-go/mapparser v0.1.9 h1:mGjRwA2twJRyzSrYuJWvyNpEkO469K/Qun327v8rhwE=
github.com/minetest-go/mapparser v0.1.9/go.mod h1:zE+JdqiicINR+kzZ4gS6BBh+vLVPQSwkYiEkG0A1Cys= github.com/minetest-go/mapparser v0.1.9/go.mod h1:zE+JdqiicINR+kzZ4gS6BBh+vLVPQSwkYiEkG0A1Cys=
github.com/minetest-go/mapparser v1.0.4 h1:JSO0JHWs6N0TB/C4cVuh58MrpO2tWV+6xdh7FYdl1hk=
github.com/minetest-go/mapparser v1.0.4/go.mod h1:h0BJu8y5cBLOD+oe9YYyF2nRZdJlQ+cA6F8YmzZpHXM=
github.com/minetest-go/types v1.0.7 h1:McQVnHQysqXegJbHnVl66TOS/172yi5b70sosWRCvuk=
github.com/minetest-go/types v1.0.7/go.mod h1:QS2q8tKAiuBe2Rin880ARFt9VokYIJNZV4Z4kHAChU0=
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=

View File

@ -7,9 +7,11 @@ function onchange(e){
m.route.set("/map/:layerId/:zoom/:lon/:lat", params); m.route.set("/map/:layerId/:zoom/:lon/:lat", params);
} }
export default { export default {
view: function(){ view: function(){
// Display layer selector only if there is choice
if (LayerManager.layers.length <= 1)
return null;
const layers = LayerManager.layers.map(layer => m( const layers = LayerManager.layers.map(layer => m(
"option", "option",

View File

@ -71,7 +71,7 @@ export default L.LayerGroup.extend({
getMaxDisplayedZoom: function(){ getMaxDisplayedZoom: function(){
return 10; return 7;
}, },
createMarker: function(train){ createMarker: function(train){

View File

@ -58,6 +58,10 @@ export default AbstractGeoJsonOverlay.extend({
} }
}); });
}, },
getMaxDisplayedZoom: function(){
return 4;
},
createGeoJson: function(objects){ createGeoJson: function(objects){
var self = this; var self = this;