homeflowjs 0.13.3 → 0.13.4

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.
@@ -30,22 +30,24 @@ class BranchMap extends React.Component {
30
30
  const {
31
31
  mapTypeControl,
32
32
  scrollWheel,
33
- zoom,
33
+ defaultZoom,
34
34
  disableStreetview,
35
35
  custom,
36
36
  iconConfig,
37
37
  fullscreenControl,
38
38
  zoomControl,
39
+ googleMapsBranchZoomLevel,
39
40
  } = this.props;
40
41
 
41
42
  // Should this be added to Redux?
42
43
  const branch = Homeflow.get('branch');
44
+ const usedZoom = parseInt(googleMapsBranchZoomLevel || defaultZoom, 10);
43
45
 
44
46
  const options = {
45
47
  center: new google.maps.LatLng(branch.lat, branch.lng),
46
48
  mapTypeControl,
47
49
  scrollWheel,
48
- zoom,
50
+ zoom: usedZoom,
49
51
  streetViewControl: !disableStreetview,
50
52
  fullscreenControl: false,
51
53
  zoomControl,
@@ -110,7 +112,7 @@ BranchMap.defaultProps = {
110
112
  mapTypeControl: false,
111
113
  scrollWheel: false,
112
114
  custom: null,
113
- zoom: 15,
115
+ defaultZoom: 15,
114
116
  disableStreetview: false,
115
117
  google: false,
116
118
  iconConfig: null,
@@ -118,11 +120,15 @@ BranchMap.defaultProps = {
118
120
  zoomControl: false,
119
121
  };
120
122
 
123
+ const mapStateToProps = (state) => ({
124
+ googleMapsBranchZoomLevel: state.app.themePreferences.googleMapsBranchZoomLevel,
125
+ });
126
+
121
127
  const mapDispatchToProps = {
122
128
  initGoogleMaps,
123
129
  };
124
130
 
125
131
  export default connect(
126
- null,
132
+ mapStateToProps,
127
133
  mapDispatchToProps,
128
134
  )(BranchMap);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homeflowjs",
3
- "version": "0.13.3",
3
+ "version": "0.13.4",
4
4
  "sideEffects": [
5
5
  "modal/**/*",
6
6
  "user/default-profile/**/*",
@@ -80,6 +80,14 @@ export default class GeonamesMap extends DraggableMap {
80
80
  */
81
81
  setTimeout(() => {
82
82
  if (!this.markersInitialized) {
83
+ const { geonames, properties } = store.getState().properties
84
+ if (!properties && !geonames?.length) {
85
+ const place = store.getState().search.currentSearch?.place;
86
+ const { lat, lng } = place;
87
+ this.map.setView(new L.LatLng(lat, lng), 14);
88
+ this.onMapDrag();
89
+ this.hideLoader();
90
+ }
83
91
  this.setMarkerTypeforZoomLevel();
84
92
  this.setMarkers();
85
93
  this.setToMarkeredBounds();
@@ -1,7 +1,7 @@
1
1
  export default `
2
2
  <div id="geonames-map-loader" class="js-geonames-map-loader geonames-map__loader-background">
3
3
  <div class="geonames-map__loader-inner">
4
- <svg width="38" height="38" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" stroke="#fff">
4
+ <svg width="100" height="100" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" stroke="gray">
5
5
  <g fill="none" fill-rule="evenodd">
6
6
  <g transform="translate(1 1)" stroke-width="2">
7
7
  <circle stroke-opacity=".5" cx="18" cy="18" r="18"/>