sr-npm 1.7.188 → 1.7.189

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/pages/homePage.js +16 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.188",
3
+ "version": "1.7.189",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/pages/homePage.js CHANGED
@@ -47,9 +47,22 @@ async function homePageOnReady(_$w,thisObject) {
47
47
  });
48
48
  _$w('#googleMaps').onMarkerClicked((event) => {
49
49
  console.log("event: ", event);
50
- // if (event.marker && event.marker.linkUrl) {
51
- // location.to(event.marker.linkUrl);
52
- // }
50
+
51
+ // Get all markers from the map
52
+ const allMarkers = _$w('#googleMaps').markers;
53
+ console.log("allMarkers: ", allMarkers);
54
+ const getMarker = _$w('#googleMaps').getMarkers();
55
+ console.log("getMarker: ", getMarker);
56
+
57
+ // Find the clicked marker by matching coordinates
58
+ const clickedMarker = allMarkers.find(marker =>
59
+ marker.location.latitude === event.location.latitude &&
60
+ marker.location.longitude === event.location.longitude
61
+ );
62
+
63
+ if (clickedMarker && clickedMarker.linkUrl) {
64
+ location.to(clickedMarker.linkUrl);
65
+ }
53
66
  });
54
67
  }
55
68