homeflowjs 0.13.50 → 0.13.52
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
@@ -681,7 +681,6 @@ export default class DraggableMap {
|
|
681
681
|
})
|
682
682
|
}
|
683
683
|
|
684
|
-
|
685
684
|
getSearchableBounds() {
|
686
685
|
return this.map.getBounds();
|
687
686
|
}
|
@@ -754,4 +753,22 @@ export default class DraggableMap {
|
|
754
753
|
hideOverlay() {
|
755
754
|
this?._overlayElement?.classList?.remove('draggable-map-overlay--show')
|
756
755
|
}
|
756
|
+
|
757
|
+
resetMap() {
|
758
|
+
const s = this.getSearch();
|
759
|
+
const url = `/search.ljson?${buildQueryString(s)}&count=50`;
|
760
|
+
fetch(url)
|
761
|
+
.then((response) => response.json())
|
762
|
+
.then((json) => {
|
763
|
+
if (this.drawSearchLoader) {
|
764
|
+
this.drawSearchLoader.style.display = 'none';
|
765
|
+
}
|
766
|
+
store.dispatch(setPagination(json.pagination))
|
767
|
+
if (json.properties) {
|
768
|
+
this.setSearchResponse(json);
|
769
|
+
} else {
|
770
|
+
store.dispatch(setProperties([]));
|
771
|
+
}
|
772
|
+
})
|
773
|
+
}
|
757
774
|
}
|
@@ -257,6 +257,25 @@ export default class DrawableMap extends DraggableMap {
|
|
257
257
|
|
258
258
|
});
|
259
259
|
|
260
|
+
Homeflow.registerEvent('drawable_map_cancelled', () => {
|
261
|
+
this.map.removeLayer(this.marker_layer);
|
262
|
+
if (this.nonClusteringMarkerLayer) { this.map.removeLayer(this.nonClusteringMarkerLayer); }
|
263
|
+
if (this.geo_marker_layer != null) { this.map.removeLayer(this.geo_marker_layer); }
|
264
|
+
store.dispatch(setSearchField({ poly: null }));
|
265
|
+
if (Homeflow.get('initial_properties_payload')) {
|
266
|
+
const initialProperties = Homeflow.get('initial_properties_payload');
|
267
|
+
this.properties = initialProperties;
|
268
|
+
this.setMarkers();
|
269
|
+
}
|
270
|
+
|
271
|
+
document.querySelector('.js-draw-map-search-loader').style.display = 'none';
|
272
|
+
this.onMapDrag();
|
273
|
+
});
|
274
|
+
|
275
|
+
Homeflow.registerEvent('reset_drawable_map', () => {
|
276
|
+
this.resetMap();
|
277
|
+
})
|
278
|
+
|
260
279
|
return this.map.on("draw:deleted", e => {
|
261
280
|
this.map.removeLayer(this.marker_layer);
|
262
281
|
if (this.nonClusteringMarkerLayer) { this.map.removeLayer(this.nonClusteringMarkerLayer); }
|