<DIV> overlay like "leaflet-control-attribution"

3,956 views
Skip to first unread message

Jack Michel

unread,
Apr 2, 2012, 6:00:21 AM4/2/12
to leafl...@googlegroups.com
Hello!

I want to show a semi transparent <div> overlay over a leaflet map at a fixed position (like the leaflet "leaflet-control-attribution").
I already tried it with z-index:

   <div id="map" style="z-index: 1;">
      <div id="overlay" style="position:absolute; top:0px; left:100px; background-color:white; width:100px; height:100px; z-index: 100"> My Test</div>
   </div>

To set the class "leaflet-control-attribution leaflet-control" to the overlay <div> doesn't work either.
Do you have some hint for me?

Thanks!

Bryan McBride

unread,
Apr 2, 2012, 10:44:33 AM4/2/12
to leafl...@googlegroups.com
Try moving the overlay div outside of the map div.

Jack Michel

unread,
Apr 4, 2012, 3:09:18 PM4/4/12
to leafl...@googlegroups.com
Bryan, your solution finally fits best. Thanks!
Reply all
Reply to author
Forward
0 new messages