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>









share|improve this question


























    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>









    share|improve this question
























      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>









      share|improve this question













      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 7 at 12:18









      John

      1811425




      1811425
























          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






          share|improve this answer





















          • Thank you. It worked.
            – John
            Nov 7 at 13:28






          • 1




            You are welcome
            – kboul
            Nov 7 at 13:37











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          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

























          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






          share|improve this answer





















          • Thank you. It worked.
            – John
            Nov 7 at 13:28






          • 1




            You are welcome
            – kboul
            Nov 7 at 13:37















          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






          share|improve this answer





















          • Thank you. It worked.
            – John
            Nov 7 at 13:28






          • 1




            You are welcome
            – kboul
            Nov 7 at 13:37













          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






          share|improve this answer












          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







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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


















          • 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


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          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





















































          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







          這個網誌中的熱門文章

          Post-Redirect-Get with Spring WebFlux and Thymeleaf

          Xamarin.form Move up view when keyboard appear

          JBPM : POST request for execute process go wrong