homeflowjs 0.13.18 → 0.13.20

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.18",
3
+ "version": "0.13.20",
4
4
  "sideEffects": [
5
5
  "modal/**/*",
6
6
  "user/default-profile/**/*",
@@ -306,6 +306,7 @@ export default class DraggableMap {
306
306
 
307
307
  this.properties.map(property => this.setPropertyMarker(property));
308
308
  this.clusteringMarkerLayer.addTo(this.map);
309
+ this.nonClusteringMarkerLayer.addTo(this.map);
309
310
 
310
311
  return this.bounds;
311
312
  }
@@ -659,7 +660,7 @@ export default class DraggableMap {
659
660
  this._running_update = false;
660
661
 
661
662
  if (json.properties) {
662
- setSearchResponse(json);
663
+ this.setSearchResponse(json);
663
664
  }
664
665
  })
665
666
  }
@@ -91,6 +91,7 @@ export default class DrawableMap extends DraggableMap {
91
91
  if (!additionalDrawing) {
92
92
  this.drawnItems.clearLayers();
93
93
  if (this.marker_layer) { this.map.removeLayer(this.marker_layer); }
94
+ if (this.nonClusteringMarkerLayer) { this.map.removeLayer(this.nonClusteringMarkerLayer); }
94
95
  if (this.geo_marker_layer != null) { this.map.removeLayer(this.geo_marker_layer); }
95
96
  if (this.circle != null) { this.map.removeLayer(this.circle); }
96
97
  }
@@ -147,6 +148,7 @@ export default class DrawableMap extends DraggableMap {
147
148
  this.map.on("draw:drawstart", e => {
148
149
  this.first = false;
149
150
  this.map.removeLayer(this.marker_layer);
151
+ if (this.nonClusteringMarkerLayer) { this.map.removeLayer(this.nonClusteringMarkerLayer); }
150
152
  if (this.geo_marker_layer) { this.map.removeLayer(this.geo_marker_layer); }
151
153
  if (this.circle) { this.map.removeLayer(this.circle); }
152
154
  return Homeflow.kickEvent('drawbannertoggled', this);
@@ -235,6 +237,7 @@ export default class DrawableMap extends DraggableMap {
235
237
 
236
238
  return this.map.on("draw:deleted", e => {
237
239
  this.map.removeLayer(this.marker_layer);
240
+ if (this.nonClusteringMarkerLayer) { this.map.removeLayer(this.nonClusteringMarkerLayer); }
238
241
  if (this.geo_marker_layer != null) { this.map.removeLayer(this.geo_marker_layer); }
239
242
  store.dispatch(setSearchField({ poly: null }));
240
243
  this.updateURL();
@@ -95,7 +95,7 @@ export default class GeonamesMap extends DraggableMap {
95
95
 
96
96
  if (!this.markersInitialized) {
97
97
  const { geonames, properties } = store.getState().properties
98
- if (!properties && !geonames?.length) {
98
+ if (!properties && !geonames?.length && !this.viewport && !store.getState().search.currentSearch?.place?.polygon) {
99
99
  const place = store.getState().search.currentSearch?.place;
100
100
  const { lat, lng } = place;
101
101
  this.map.setView(new L.LatLng(lat, lng), 14);
@@ -118,7 +118,7 @@ export default class GeonamesMap extends DraggableMap {
118
118
 
119
119
  if (!zoomLevel) zoomLevel = window.lastZoomLevel;
120
120
 
121
- if (zoomLevel > 9) {
121
+ if (zoomLevel > this.locationPinsMaxZoomLevel) {
122
122
  window.markerType = 'properties';
123
123
  } else {
124
124
  window.markerType = 'geonames';
@@ -181,6 +181,8 @@ export default class GeonamesMap extends DraggableMap {
181
181
  geonamesInit() {
182
182
  if (!this.map || this.geonamesInitialized) return;
183
183
 
184
+ this.locationPinsMaxZoomLevel = store.getState().app.themePreferences?.locationPinsMaxZoomLevel || 9;
185
+
184
186
  const { geonames } = store.getState().properties;
185
187
 
186
188
  if (geonames && !this.geonames) {
@@ -195,14 +197,14 @@ export default class GeonamesMap extends DraggableMap {
195
197
  const zoomLevel = this.map.getZoom();
196
198
 
197
199
  // If we don't have any geonames we need to show property markers
198
- if (!geonames && zoomLevel > 9) window.markerType = 'properties';
200
+ if (!geonames && zoomLevel > this.locationPinsMaxZoomLevel) window.markerType = 'properties';
199
201
 
200
202
  /**
201
203
  * If we don't have any geonames we need to run onMapDrag
202
204
  * as it doesn't run for open searches otherwise and we need
203
205
  * it to load geonames
204
206
  */
205
- if (!geonames && zoomLevel < 10) {
207
+ if (!geonames && zoomLevel < this.locationPinsMaxZoomLevel) {
206
208
  this.onMapDrag();
207
209
  window.markerType = 'geonames';
208
210
  }