I am creating dynamic popups based on the response from DB, and I implemented a leaflet-responsive-popup which works fine when opening on edges (left, right, top), however, it does not function correctly on the bottom edge, and if for example opening on the middle of the screen.
Here is image of bottom:
https://postimg.cc/75xzR4RN
If I open in the middle the popup is opened but OVER the icon not on top. Sorry for the black dots on the image but I need to hide that data.
LINK: https://postimg.cc/zySjLpsx
However, if I now leave the popup open and scroll then the popup gets positioned correctly?
this.map = L.mapquest.map('map', {
center: [25.73, 30.3],
layers: [L.mapquest.tileLayer('map')],
zoom: 2.5,
minZoom: 3,
maxZoom: 16,
closePopupOnClick: false,
doubleClickZoom: false,
zoomControl: false
});
this.redIcon = L.divIcon({
className: 'icn',
iconSize: 20,
iconAnchor: [10, 20],
popupAnchor: [0, 0],
html: '<div class="map-pin map-pin--with-icon map-pin--red"><span class="material-icons">close</span></div><div class="map-pin-pulse"></div>',
});
var popup = L.responsivePopup({
hasTip: true,
autoPan: true,
}).setContent(
fl => {
const popupEl: NgElement & WithProperties<MyPopupComponent> = document.createElement('popup-element') as any;
popupEl.object = object;
popupEl.map = this.map;
popupEl.takeFn = () => this.statusAndCount();
popupEl.addEventListener('closed', () => document.body.removeChild(popupEl));
/* document.body.appendChild(popupEl); */
return popupEl;
}
);
let tempMarker = L.marker([object.LATITUDE, object.LONGITUDE], {
icon: tempIcon,
draggable: false,
zIndexOffset: object.Z_INDEX
}).addTo(this.map).bindPopup(
popup
, {
maxWidth: 800,
minWidth: 700,
})
return tempMarker;