Html div z-index on Leaflet map selectable - Javascript Leaflet

Javascript examples for Leaflet:Map

Description

Html div z-index on Leaflet map selectable

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <link rel="stylesheet" type="text/css" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css"> 
      <script type="text/javascript" src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script> 
      <style id="compiled-css" type="text/css">

.map_holder{//from   w  w  w.  j a v  a2s  . c  o  m
   position: relative;
   width: 700px;
   height: 600px;
}
#map {
   height: 500px;
   width: 700px;
}
.box{
   position:absolute;
   width:100%;
   height:100px;
   background-color:rgba(255,250,245,0.5);
   bottom:100px;
   z-index: 1000;
}
      </style> 
      <script type="text/javascript">
    window.onload=function(){
       var osmUrl = 'http://{s}.tile.osm.org/{z}/{x}/{y}.png',
           osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
           osm = L.tileLayer(osmUrl, {
               maxZoom: 18,
               attribution: osmAttrib
           });
       var map = L.map('map').setView([19.04469, 72.9258], 12).addLayer(osm);
    }

      </script> 
   </head> 
   <body> 
      <div class="map_holder"> 
         <div id="map"></div> 
         <div class="box">
             You can't drag the map here 
         </div> 
      </div>  
   </body>
</html>

Related Tutorials