[TASK] Add zoom-control & adjust style

This commit is contained in:
Xaver Maierhofer 2017-02-26 16:09:23 +01:00
parent 2a446e719d
commit 4f48a7a07c
No known key found for this signature in database
GPG Key ID: 7FDCE23FD2EC9FE8
3 changed files with 66 additions and 11 deletions

View File

@ -6,7 +6,7 @@ define(['map/clientlayer', 'map/labelslayer',
var options = {
worldCopyJump: true,
zoomControl: false
zoomControl: true
};
var ButtonBase = L.Control.extend({
@ -296,6 +296,8 @@ define(['map/clientlayer', 'map/labelslayer',
layerControl = L.control.layers(baseLayers, [], { position: 'bottomright' });
layerControl.addTo(map);
map.zoomControl.setPosition('topright');
var clientLayer = new ClientLayer({ minZoom: config.clientZoom });
clientLayer.addTo(map);
clientLayer.setZIndex(5);

View File

@ -36,17 +36,27 @@
}
.leaflet-control-layers-toggle {
background: none;
height: auto;
width: auto;
background: $color-white;
border-radius: 50%;
color: $color-black;
display: block;
font-size: 1.6rem;
height: 1.8em;
line-height: 1.95;
margin-right: 16px;
opacity: .7;
text-align: center;
transition: background-color .5s, color .5s;
width: 1.8em;
@media screen and (max-width: map-get($grid-breakpoints, lg) - 1) {
margin-right: -2px;
transform: scale(.8);
}
&::before {
color: $color-primary;
content: '\f229';
display: inline-block;
font-family: $font-family-icons;
font-size: 2.3rem;
line-height: 1;
font-family: ionicons;
speak: none;
text-rendering: auto;
}
@ -309,3 +319,36 @@
}
}
}
.leaflet-control-zoom {
opacity: .7;
right: 16px;
top: 65px;
@media screen and (max-width: map-get($grid-breakpoints, lg) - 1) {
right: calc(100vw - 50px);
top: -10px;
transform: scale(.8);
}
a {
background: $color-white;
border-radius: 5px 5px 0 0;
color: $color-black;
display: block;
font-size: 40px;
height: 46px;
text-align: center;
transition: background-color .5s, color .5s;
width: 46px;
&:hover {
color: $color-primary;
}
+ a {
border-radius: 0 0 5px 5px;
border-top: 1px solid $color-gray-light;
}
}
}

View File

@ -17,18 +17,28 @@ html {
background: transparentize($color-black, .98);
}
//@import 'leaflet';
//@import 'modules/leaflet';
.leaflet-container {
background: $color-map-background;
}
//@import 'modules/leaflet';
.leaflet-label {
&.leaflet-label-right {
background-color: $color-white;
}
}
.leaflet-control-zoom {
a {
background: lighten($color-white, 10);
color: $color-black;
&:hover {
background: $color-white;
}
}
}
.leaflet-control-layers {
&.leaflet-control {
opacity: .9;