Bootstrap Angular Leaflet Div above map
up vote
0
down vote
favorite
I'm trying to put a div above the map , to put some actions, like filters and stuff but the div only appears when I move the map and the it goes behind the map.
component css:
.map {
padding: 0;
position:relative;
width:100% ;
height: 100%;
}
.mapContainer{
width: 100vw;
height: 92.6vh; /* Fallback for browsers that do not support Custom Properties */
height: calc(var(--vh, 1vh) * 92.6);
padding: 0 ;
}
.overlay {
width: 100px;
position: absolute;
top: 0;
left: 0;
bottom: 0;
background-color: rgba(255, 50, 50, 0.5);
}
component html :
<div class="container-fluid" >
<div class="row">
<div class="col-sm-2">
<div *ngIf="city">
<p>{{city.name}} </p>
</div>
</div>
<div class="col-sm-10 mapContainer" >
<div leaflet class="map"
[leafletOptions]="options"
[leafletFitBounds]="bounds"
(leafletMapReady)="onMapReady($event)"
[leafletMarkerCluster]="markerClusterData"
[leafletMarkerClusterOptions]="markerClusterOptions"
(leafletMarkerClusterReady)="markerClusterReady($event)">
</div>
<div class = "overlay">
<input type="radio" class = "someButton">Foo Bar
</div>
</div>
</div>
angular twitter-bootstrap bootstrap-4 leaflet angular-leaflet-directive
add a comment |
up vote
0
down vote
favorite
I'm trying to put a div above the map , to put some actions, like filters and stuff but the div only appears when I move the map and the it goes behind the map.
component css:
.map {
padding: 0;
position:relative;
width:100% ;
height: 100%;
}
.mapContainer{
width: 100vw;
height: 92.6vh; /* Fallback for browsers that do not support Custom Properties */
height: calc(var(--vh, 1vh) * 92.6);
padding: 0 ;
}
.overlay {
width: 100px;
position: absolute;
top: 0;
left: 0;
bottom: 0;
background-color: rgba(255, 50, 50, 0.5);
}
component html :
<div class="container-fluid" >
<div class="row">
<div class="col-sm-2">
<div *ngIf="city">
<p>{{city.name}} </p>
</div>
</div>
<div class="col-sm-10 mapContainer" >
<div leaflet class="map"
[leafletOptions]="options"
[leafletFitBounds]="bounds"
(leafletMapReady)="onMapReady($event)"
[leafletMarkerCluster]="markerClusterData"
[leafletMarkerClusterOptions]="markerClusterOptions"
(leafletMarkerClusterReady)="markerClusterReady($event)">
</div>
<div class = "overlay">
<input type="radio" class = "someButton">Foo Bar
</div>
</div>
</div>
angular twitter-bootstrap bootstrap-4 leaflet angular-leaflet-directive
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to put a div above the map , to put some actions, like filters and stuff but the div only appears when I move the map and the it goes behind the map.
component css:
.map {
padding: 0;
position:relative;
width:100% ;
height: 100%;
}
.mapContainer{
width: 100vw;
height: 92.6vh; /* Fallback for browsers that do not support Custom Properties */
height: calc(var(--vh, 1vh) * 92.6);
padding: 0 ;
}
.overlay {
width: 100px;
position: absolute;
top: 0;
left: 0;
bottom: 0;
background-color: rgba(255, 50, 50, 0.5);
}
component html :
<div class="container-fluid" >
<div class="row">
<div class="col-sm-2">
<div *ngIf="city">
<p>{{city.name}} </p>
</div>
</div>
<div class="col-sm-10 mapContainer" >
<div leaflet class="map"
[leafletOptions]="options"
[leafletFitBounds]="bounds"
(leafletMapReady)="onMapReady($event)"
[leafletMarkerCluster]="markerClusterData"
[leafletMarkerClusterOptions]="markerClusterOptions"
(leafletMarkerClusterReady)="markerClusterReady($event)">
</div>
<div class = "overlay">
<input type="radio" class = "someButton">Foo Bar
</div>
</div>
</div>
angular twitter-bootstrap bootstrap-4 leaflet angular-leaflet-directive
I'm trying to put a div above the map , to put some actions, like filters and stuff but the div only appears when I move the map and the it goes behind the map.
component css:
.map {
padding: 0;
position:relative;
width:100% ;
height: 100%;
}
.mapContainer{
width: 100vw;
height: 92.6vh; /* Fallback for browsers that do not support Custom Properties */
height: calc(var(--vh, 1vh) * 92.6);
padding: 0 ;
}
.overlay {
width: 100px;
position: absolute;
top: 0;
left: 0;
bottom: 0;
background-color: rgba(255, 50, 50, 0.5);
}
component html :
<div class="container-fluid" >
<div class="row">
<div class="col-sm-2">
<div *ngIf="city">
<p>{{city.name}} </p>
</div>
</div>
<div class="col-sm-10 mapContainer" >
<div leaflet class="map"
[leafletOptions]="options"
[leafletFitBounds]="bounds"
(leafletMapReady)="onMapReady($event)"
[leafletMarkerCluster]="markerClusterData"
[leafletMarkerClusterOptions]="markerClusterOptions"
(leafletMarkerClusterReady)="markerClusterReady($event)">
</div>
<div class = "overlay">
<input type="radio" class = "someButton">Foo Bar
</div>
</div>
</div>
angular twitter-bootstrap bootstrap-4 leaflet angular-leaflet-directive
angular twitter-bootstrap bootstrap-4 leaflet angular-leaflet-directive
asked Nov 7 at 12:18
John
1811425
1811425
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Since you have used position: absolute
in your overlay
class you can apply the z-index
property to be equal or more 1000
so it is in front of the map element which has lower z-index value.
.overlay {
width: 100px;
position: absolute;
top: 0;
left: 0;
bottom: 0;
background-color: rgba(255, 50, 50, 0.5);
z-index: 1000
}
Demo
Thank you. It worked.
– John
Nov 7 at 13:28
1
You are welcome
– kboul
Nov 7 at 13:37
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Since you have used position: absolute
in your overlay
class you can apply the z-index
property to be equal or more 1000
so it is in front of the map element which has lower z-index value.
.overlay {
width: 100px;
position: absolute;
top: 0;
left: 0;
bottom: 0;
background-color: rgba(255, 50, 50, 0.5);
z-index: 1000
}
Demo
Thank you. It worked.
– John
Nov 7 at 13:28
1
You are welcome
– kboul
Nov 7 at 13:37
add a comment |
up vote
1
down vote
accepted
Since you have used position: absolute
in your overlay
class you can apply the z-index
property to be equal or more 1000
so it is in front of the map element which has lower z-index value.
.overlay {
width: 100px;
position: absolute;
top: 0;
left: 0;
bottom: 0;
background-color: rgba(255, 50, 50, 0.5);
z-index: 1000
}
Demo
Thank you. It worked.
– John
Nov 7 at 13:28
1
You are welcome
– kboul
Nov 7 at 13:37
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Since you have used position: absolute
in your overlay
class you can apply the z-index
property to be equal or more 1000
so it is in front of the map element which has lower z-index value.
.overlay {
width: 100px;
position: absolute;
top: 0;
left: 0;
bottom: 0;
background-color: rgba(255, 50, 50, 0.5);
z-index: 1000
}
Demo
Since you have used position: absolute
in your overlay
class you can apply the z-index
property to be equal or more 1000
so it is in front of the map element which has lower z-index value.
.overlay {
width: 100px;
position: absolute;
top: 0;
left: 0;
bottom: 0;
background-color: rgba(255, 50, 50, 0.5);
z-index: 1000
}
Demo
answered Nov 7 at 13:13
kboul
1,60421123
1,60421123
Thank you. It worked.
– John
Nov 7 at 13:28
1
You are welcome
– kboul
Nov 7 at 13:37
add a comment |
Thank you. It worked.
– John
Nov 7 at 13:28
1
You are welcome
– kboul
Nov 7 at 13:37
Thank you. It worked.
– John
Nov 7 at 13:28
Thank you. It worked.
– John
Nov 7 at 13:28
1
1
You are welcome
– kboul
Nov 7 at 13:37
You are welcome
– kboul
Nov 7 at 13:37
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53189337%2fbootstrap-angular-leaflet-div-above-map%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown