Config option for tile layers.

See: https://github.com/freifunkhamburg/ffffng/issues/23
This commit is contained in:
baldo 2016-07-14 16:28:17 +02:00
parent 51978bfd70
commit 7c09523e53
6 changed files with 30 additions and 17 deletions

View file

@ -342,6 +342,12 @@ module.exports = function (grunt) {
'fonts/*' 'fonts/*'
] ]
}, },
{
expand: true,
cwd: '<%= yeoman.app %>/bower_components/leaflet-dist/images',
dest: '<%= yeoman.dist %>/client/styles/images',
src: ['*.png']
},
{ {
expand: true, expand: true,
cwd: '.tmp/images', cwd: '.tmp/images',

View file

@ -29,20 +29,9 @@ angular.module('ffffng')
zoom: config.coordsSelector.defaultZoom zoom: config.coordsSelector.defaultZoom
}, },
markers: {}, markers: {},
hasMultipleLayers: _.size(config.coordsSelector.layers) > 1,
layers: { layers: {
baselayers: { baselayers: config.coordsSelector.layers
osm: {
name: 'MapQuest (OSM)',
url: 'https://otile{s}-s.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
type: 'xyz',
layerOptions: {
subdomains: '1234',
attribution:
'Tiles &copy; <a href=\"https://www.mapquest.com/\" target=\"_blank\">MapQuest</a>, ' +
'Data CC-BY-SA OpenStreetMap'
}
}
}
} }
}; };

View file

@ -123,9 +123,25 @@ f-node-form {
margin-top: 5px; margin-top: 5px;
margin-bottom: 20px; margin-bottom: 20px;
.leaflet-control-layers.leaflet-control { &.map-hide-layers-control .leaflet-control-layers.leaflet-control {
display: none; display: none;
} }
// reset styling from bootstrap as it breaks the layer control
.leaflet-control-layers {
input {
display: initial;
border: initial;
box-shadow: initial;
width: initial;
height: initial;
}
input, label {
margin: initial;
padding: initial;
}
}
} }
.buttons { .buttons {

View file

@ -59,7 +59,7 @@
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<leaflet <leaflet
class="map" class="map" ng-class="{'map-hide-layers-control' : !map.hasMultipleLayers }"
center="map.center" center="map.center"
layers="map.layers" layers="map.layers"
markers="map.markers" markers="map.markers"

View file

@ -51,7 +51,8 @@
"coordsSelector": { "coordsSelector": {
"lat": 53.565278, "lat": 53.565278,
"lng": 10.001389, "lng": 10.001389,
"defaultZoom": 10 "defaultZoom": 10,
"layers": {}
}, },
"otherCommunityInfo": { "otherCommunityInfo": {
"showInfo": true, "showInfo": true,

View file

@ -109,7 +109,8 @@ var defaultConfig = {
localCommunityPolygon: [], localCommunityPolygon: [],
lat: 53.565278, lat: 53.565278,
lng: 10.001389, lng: 10.001389,
defaultZoom: 10 defaultZoom: 10,
layers: {}
} }
} }
}; };