sr-npm 1.7.188 → 1.7.190

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 +18 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.188",
3
+ "version": "1.7.190",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/pages/homePage.js CHANGED
@@ -39,7 +39,8 @@ async function homePageOnReady(_$w,thisObject) {
39
39
  address: item.locationAddress.formatted,
40
40
  description: `View ${item.count} Open Positions`,
41
41
  title: item.title, // Show the actual city name in title
42
- linkUrl: cityLinkUrl
42
+ link: cityLinkUrl,
43
+ linkTitle:"shit"
43
44
  };
44
45
  });
45
46
  //@ts-ignore
@@ -47,9 +48,22 @@ async function homePageOnReady(_$w,thisObject) {
47
48
  });
48
49
  _$w('#googleMaps').onMarkerClicked((event) => {
49
50
  console.log("event: ", event);
50
- // if (event.marker && event.marker.linkUrl) {
51
- // location.to(event.marker.linkUrl);
52
- // }
51
+
52
+ // Get all markers from the map
53
+ const allMarkers = _$w('#googleMaps').markers;
54
+ console.log("allMarkers: ", allMarkers);
55
+ const getMarker = _$w('#googleMaps').getMarkers();
56
+ console.log("getMarker: ", getMarker);
57
+
58
+ // Find the clicked marker by matching coordinates
59
+ const clickedMarker = allMarkers.find(marker =>
60
+ marker.location.latitude === event.location.latitude &&
61
+ marker.location.longitude === event.location.longitude
62
+ );
63
+
64
+ if (clickedMarker && clickedMarker.linkUrl) {
65
+ location.to(clickedMarker.linkUrl);
66
+ }
53
67
  });
54
68
  }
55
69