Skip to content

Commit

Permalink
Merge pull request #77 from leslieli/master
Browse files Browse the repository at this point in the history
MAX-28523: Add NULL checking for the popup of highlighted marker.
  • Loading branch information
leslieli authored Oct 21, 2022
2 parents a2940bb + c700695 commit 9556786
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v3.19.31
===================
## Bug Fix:
* Add NULL checking for the popup when highlighting the marker of `px-map-marker-group`.

v3.19.30
===================
## Change Request:
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "px-map",
"version": "3.19.30",
"version": "3.19.31",
"description": "A lightweight framework for building interactive maps with web components",
"main": [
"px-map.html"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "px-map",
"author": "General Electric",
"description": "A lightweight framework for building interactive maps with web components",
"version": "3.19.30",
"version": "3.19.31",
"private": false,
"extName": null,
"repository": {
Expand Down
11 changes: 8 additions & 3 deletions px-map-behavior-marker-group.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,17 @@
L.DomUtil.addClass(marker._icon, this.riseClass);

// update the position of the popup when highlighting
const popup = marker.getPopup().getElement();
const bottomStyle = popup.style.bottom;
const popup = marker.getPopup();
if (!popup) {
return;
}

const popupEle = popup.getElement();
const bottomStyle = popupEle.style.bottom;
if (bottomStyle && bottomStyle.indexOf('px') !== -1) {
const bottomValue = bottomStyle.replace('px','');
// 10: should match to the value of --internal-px-map-icon-position-top
popup.style.bottom = (Math.floor(bottomValue) + 10) + 'px';
popupEle.style.bottom = (Math.floor(bottomValue) + 10) + 'px';
}
}
}
Expand Down

0 comments on commit 9556786

Please sign in to comment.