You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a layer entity is clicked, the popup is shown but partly hidden which is caused by wrong centering (clicked point is centered).
In 3418146 I adjusted the centered point by using the viewport/map size. This works for the current max. size of the popups but is not responsive and may doesn't work as desired for larger popups in the future.
I have a responsive solution which considers the popup size (found here):
var px = layer._map.project(layer._popup._latlng); // find the pixel location on the map where the popup anchor is
px.y -= layer._popup._container.clientHeight/2; // find the height of the popup container, divide by 2, subtract from the Y axis of marker location
layer._map.panTo(layer._map.unproject(px), {animate: true, duration: 1}); // pan to new center
But: The loading of popup content is delayed by 250ms so the panning needs to be delayed as well to obtain the correct popup size. The result looks quite "laggy" due to the delay as well as due to the initial default panning which is interrupted by this custom panning. Hence I didn't use this solution.
The solution in 3418146 is ok for now but may be replaced by a responsive approach later.
The text was updated successfully, but these errors were encountered:
When a layer entity is clicked, the popup is shown but partly hidden which is caused by wrong centering (clicked point is centered).
In 3418146 I adjusted the centered point by using the viewport/map size. This works for the current max. size of the popups but is not responsive and may doesn't work as desired for larger popups in the future.
I have a responsive solution which considers the popup size (found here):
But: The loading of popup content is delayed by 250ms so the panning needs to be delayed as well to obtain the correct popup size. The result looks quite "laggy" due to the delay as well as due to the initial default panning which is interrupted by this custom panning. Hence I didn't use this solution.
The solution in 3418146 is ok for now but may be replaced by a responsive approach later.
The text was updated successfully, but these errors were encountered: