homeflowjs 0.13.22 → 0.13.23

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": "homeflowjs",
3
- "version": "0.13.22",
3
+ "version": "0.13.23",
4
4
  "sideEffects": [
5
5
  "modal/**/*",
6
6
  "user/default-profile/**/*",
@@ -146,6 +146,9 @@ export default class DrawableMap extends DraggableMap {
146
146
  });
147
147
 
148
148
  this.map.on("draw:drawstart", e => {
149
+ if (!Homeflow.get('initial_properties_payload')) {
150
+ Homeflow.set('initial_properties_payload', this.properties);
151
+ }
149
152
  this.first = false;
150
153
  this.map.removeLayer(this.marker_layer);
151
154
  if (this.nonClusteringMarkerLayer) { this.map.removeLayer(this.nonClusteringMarkerLayer); }
@@ -242,6 +245,11 @@ export default class DrawableMap extends DraggableMap {
242
245
  store.dispatch(setSearchField({ poly: null }));
243
246
  this.updateURL();
244
247
  Homeflow.kickEvent('deletebannertoggled');
248
+ if (Homeflow.get('initial_properties_payload')) {
249
+ const initialProperties = Homeflow.get('initial_properties_payload');
250
+ this.properties = initialProperties;
251
+ this.setMarkers();
252
+ }
245
253
  if (this.circle != null) {
246
254
  this.map.addLayer(this.circle);
247
255
  this.onMapDrag();
@@ -7,6 +7,9 @@ import { setInitialSearch, setPlace, setSearchField } from '../../actions/search
7
7
  import { buildQueryString } from '../../search/property-search/property-search';
8
8
  import mapLoader from './map-loader';
9
9
  import './geonames.css';
10
+ import Toastify from 'toastify-js';
11
+ import 'toastify-js/src/toastify.css';
12
+ import { sanitizeText } from '../../utils/index';
10
13
 
11
14
  export default class GeonamesMap extends DraggableMap {
12
15
  constructor() {
@@ -69,6 +72,16 @@ export default class GeonamesMap extends DraggableMap {
69
72
  this.map.on('zoomend', () => {
70
73
  this.setMarkerTypeforZoomLevel()
71
74
 
75
+ const zoomLevel = this.map.getZoom();
76
+ const pagination = store.getState().properties?.pagination;
77
+ const propertiesShown = this.properties.length;
78
+
79
+ if (zoomLevel > this.locationPinsMaxZoomLevel
80
+ && zoomLevel < 16
81
+ && pagination?.total_count > propertiesShown) {
82
+ this.showToastMessage('Too many properties to show. Zoom in.');
83
+ }
84
+
72
85
  this.setMarkers();
73
86
  });
74
87
 
@@ -420,6 +433,21 @@ export default class GeonamesMap extends DraggableMap {
420
433
  }
421
434
  }
422
435
 
436
+ showToastMessage(message) {
437
+ const primaryColour = store.getState().app.themePreferences.primaryColour;
438
+ Toastify({
439
+ duration: 5000,
440
+ close: true,
441
+ gravity: 'bottom',
442
+ position: 'center',
443
+ stopOnFocus: true,
444
+ text: sanitizeText(message),
445
+ escapeMarkup: false,
446
+ className: 'properties-map-toast',
447
+ style: { background: primaryColour, marginBottom: '200px', },
448
+ }).showToast();
449
+ }
450
+
423
451
  onMapDrag({ markerPlaceId } = { markerPlaceId: null }) {
424
452
  this.showLoader();
425
453