sr-npm 1.7.214 → 1.7.216

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.214",
3
+ "version": "1.7.216",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -238,7 +238,7 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
238
238
 
239
239
  const count = await updateCount(_$w);
240
240
  console.log("updating map markers");
241
- await updateMapMarkers(_$w,count);
241
+ await updateMapMarkers(_$w);
242
242
  console.log("updating map markers completed");
243
243
  count ? _$w('#resultsMultiState').changeState('results') : _$w('#resultsMultiState').changeState('noResults');
244
244
 
@@ -259,6 +259,7 @@ async function resetFilters(_$w) {
259
259
  _$w('#resetFiltersButton').disable();
260
260
 
261
261
  queryParams.remove(["keyWord", "department","page","location"]);
262
+ await updateMapMarkers(_$w);
262
263
 
263
264
  await updateCount(_$w);
264
265
  }
@@ -338,9 +339,9 @@ async function handleLocationParam(_$w,location) {
338
339
 
339
340
  }
340
341
 
341
- async function updateMapMarkers(_$w,count){
342
- if(count>0){
342
+ async function updateMapMarkers(_$w){
343
343
  const numOfItems = await _$w('#jobsDataset').getTotalCount();
344
+ if(numOfItems>0){
344
345
  const items = await _$w('#jobsDataset').getItems(0, numOfItems);
345
346
  const markers = items.items.map(item => {
346
347
  const location = item.locationAddress.location;
@@ -353,11 +354,20 @@ async function updateMapMarkers(_$w,count){
353
354
  title: item.title,
354
355
  };
355
356
  });
357
+ console.log("markers: ", markers);
358
+ console.log("type of markers: ", typeof markers);
356
359
  //@ts-ignore
357
360
  _$w('#googleMaps').setMarkers(markers);
358
361
  }
359
362
  else{
360
- _$w('#googleMaps').setMarkers([]);
363
+ console.log("no positions found");
364
+ _$w('#googleMaps').setMarkers([{
365
+ location: {
366
+ latitude: 0,
367
+ longitude: 0
368
+ },
369
+ address: "No positions found",
370
+ }]);
361
371
  }
362
372
  }
363
373