homeflowjs 0.12.18 → 0.12.19

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.12.18",
3
+ "version": "0.12.19",
4
4
  "sideEffects": [
5
5
  "modal/**/*",
6
6
  "user/default-profile/**/*",
@@ -101,7 +101,7 @@ export default class DraggableMap {
101
101
  if (marker.property.geoname_id && marker.property.viewport) {
102
102
  this.bounds = this.getViewportBounds(marker.property.viewport);
103
103
  this.map.fitBounds(this.bounds, Homeflow.get('custom_map_bounds_padding'));
104
- this.onMapDrag();
104
+ this.onMapDrag({ markerPlaceId: marker.property.geoname_id });
105
105
  }
106
106
  }
107
107
 
@@ -462,7 +462,7 @@ export default class DraggableMap {
462
462
  }
463
463
 
464
464
 
465
- onMapDrag() {
465
+ onMapDrag({ markerPlaceId } = { markerPlaceId: null }) {
466
466
  if (Homeflow.get('disable_draggable_map') || this.drawableMapInitialized) return;
467
467
 
468
468
  let url;
@@ -494,6 +494,10 @@ export default class DraggableMap {
494
494
  Homeflow.kickEvent('before_draggable_map_updated');
495
495
  url = url + '&zoom_level=' + this.map.getZoom();
496
496
 
497
+ if (markerPlaceId) {
498
+ url = url + `&marker_place_id=${markerPlaceId}`;
499
+ }
500
+
497
501
  return fetch(url)
498
502
  .then((response) => response.json())
499
503
  .then(json => {
@@ -27,9 +27,9 @@ export default class DrawableMap extends DraggableMap {
27
27
  }
28
28
  }
29
29
 
30
- onMapDrag() {
30
+ onMapDrag({ markerPlaceId } = { markerPlaceId: null }) {
31
31
  if (this.drawnItems.getLayers().length === 0) {
32
- return super.onMapDrag();
32
+ return super.onMapDrag({ markerPlaceId });
33
33
  } else {
34
34
  return this.onPolygonDrawn(this.drawnItems.getLayers()[0], false);
35
35
  }