Skip to content

Commit

Permalink
fix: use incorrect latlng on spiderfied markers
Browse files Browse the repository at this point in the history
  • Loading branch information
le-jeu committed Oct 31, 2023
1 parent d4c4308 commit 996fb92
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/code/map/portal.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,28 @@ export const WLPortal = L.Marker.extend({
L.DomEvent.on(gmapButton, "click", (ev) => {
L.DomEvent.stop(ev);
this.closePopup();
const latLng = this.getLatLng();
const operation = getSelectedOperation();
const portal = operation.getPortal(this.options.portalId);
if (!portal) return;
// use intent on android
if (
typeof window.android !== "undefined" &&
window.android &&
window.android.intentPosLink
) {
window.android.intentPosLink(
+latLng.lat,
+latLng.lng,
+portal.lat,
+portal.lng,
window.map.getZoom(),
this.options.title,
true
);
} else {
window.open(
"https://www.google.com/maps/search/?api=1&query=" +
latLng.lat +
portal.lat +
"," +
latLng.lng
portal.lng
);
}
});
Expand Down

0 comments on commit 996fb92

Please sign in to comment.