I have an aura component map made with leaflet. Everything works fine, except that when I scroll down the page, the map doesn't disappear behind the top part of the screen like it should.
See attached pictures - the first one is how it regularly looks within the page, the second one shows how the map doesn't disappear with the rest of the component. Everything above the green line shouldn't be seen.
How do I fix this?
P.S. - This component was made by someone else, so I don't know much about how it works. I'm just trying to fix the bug.
*Edited to add code below
.cmp
<aura:component implements="force:appHostable, flexipage:availableForAllPageTypes, flexipage:availableForRecordHome, force:hasRecordId, forceCommunity:availableForAllPageTypes" access="global" extends="c:Base">
<aura:attribute name="mapMarkers" type="Object" />
<aura:attribute name="markersTitle" type="String" />
<aura:attribute name="zoomLevel" type="Integer" />
<aura:attribute name="listView" type="String" />
<!-- <aura:attribute name="center" type="Object"/> -->
<aura:attribute name="jsLoaded" type="boolean" default="false"/>
<ltng:require styles="{!$Resource.leaflet + '/leaflet.css'}"
scripts="{!$Resource.leaflet + '/leaflet.js'}"
afterScriptsLoaded="{!c.jsLoaded}" />
<!-- the map component -->
<div aura:id="map"></div>
</aura:component>
.css
.THIS {
width: 100%;
height: 100%;
}
.THIS .pin {
animation-duration: 2s;
animation-iteration-count: infinite;
}
.THIS .bounce {
animation-name: bounce-1;
animation-timing-function: linear;
}
@keyframes bounce {
0% {
transform: translateY(0);
}
50% {
transform: translateY(-100px);
}
100% {
transform: translateY(0);
}
}
Controller.js
({
jsLoaded: function(component) {
component.set("v.jsLoaded", true);
},
onInIt: function(component,event,helper){
helper.rerender(component);
}
})
Helper.js (there's no active code here - there's code written but it's all commented out)
({
});
z-index
of the leaflet container to a value lower than of the standard header.