@appbaseio/reactivesearch-vue 1.16.0-alpha.34 → 1.16.0-alpha.37

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.
Files changed (89) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +15843 -10573
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/{Button-11307285.js → Button-d2f1aeda.js} +1 -1
  6. package/dist/cjs/{CancelSvg-4aa35935.js → CancelSvg-82021d23.js} +1 -1
  7. package/dist/cjs/{Card-fd94ef07.js → Card-4b915733.js} +2 -2
  8. package/dist/cjs/{ComponentWrapper-32481890.js → ComponentWrapper-7302fe1a.js} +2 -2
  9. package/dist/cjs/{Container-526efa6a.js → Container-8a08d663.js} +1 -1
  10. package/dist/cjs/DataSearch.js +2107 -18
  11. package/dist/cjs/{DropDown-cf9bfffc.js → DropDown-c46d8b0c.js} +19 -14
  12. package/dist/cjs/DynamicRangeSlider.js +68 -26
  13. package/dist/cjs/{Flex-f146cdad.js → Flex-699639d2.js} +1 -1
  14. package/dist/cjs/{FormControlList-808dbcef.js → FormControlList-73497794.js} +1 -1
  15. package/dist/cjs/{Input-3cc3fa59.js → Input-c6f181d5.js} +1 -1
  16. package/dist/cjs/{ListItem-b40adb04.js → ListItem-933c27e4.js} +2 -2
  17. package/dist/cjs/MultiDropdownList.js +34 -28
  18. package/dist/cjs/MultiList.js +43 -32
  19. package/dist/cjs/MultiRange.js +7 -7
  20. package/dist/cjs/Pagination-1b2320a7.js +177 -0
  21. package/dist/cjs/RangeInput.js +13 -9
  22. package/dist/cjs/RangeSlider.js +7 -7
  23. package/dist/cjs/ReactiveBase.js +3 -3
  24. package/dist/cjs/ReactiveComponent.js +34 -64
  25. package/dist/cjs/ReactiveGoogleMap.js +1764 -0
  26. package/dist/cjs/ReactiveList.js +66 -231
  27. package/dist/cjs/ResultCard.js +4 -4
  28. package/dist/cjs/ResultList.js +4 -4
  29. package/dist/cjs/SelectedFilters.js +6 -6
  30. package/dist/cjs/SingleDropdownList.js +28 -22
  31. package/dist/cjs/SingleList.js +25 -20
  32. package/dist/cjs/SingleRange.js +7 -7
  33. package/dist/cjs/StateProvider.js +2 -2
  34. package/dist/cjs/{Title-584a8cc8.js → Title-39765ee6.js} +1 -1
  35. package/dist/cjs/ToggleButton.js +7 -7
  36. package/dist/cjs/{_rollupPluginBabelHelpers-f127c8b7.js → _rollupPluginBabelHelpers-4abdbfff.js} +17 -0
  37. package/dist/cjs/{index-89c39a9e.js → index-d44a0a21.js} +11 -5
  38. package/dist/cjs/index.js +32 -23
  39. package/dist/cjs/initReactivesearch.js +98 -81
  40. package/dist/cjs/install.js +43 -37
  41. package/dist/cjs/{ssr-0ee35a09.js → ssr-c333c82c.js} +1 -1
  42. package/dist/cjs/{utils-1219e1fe.js → utils-23afb20b.js} +1 -1
  43. package/dist/cjs/version.js +1 -1
  44. package/dist/cjs/{vueTypes-57d01f18.js → vueTypes-6de9d2a9.js} +24 -13
  45. package/dist/es/{Button-91561391.js → Button-799185e2.js} +1 -1
  46. package/dist/es/{CancelSvg-c2c03a35.js → CancelSvg-4d9e0857.js} +1 -1
  47. package/dist/es/{Card-6446f1b7.js → Card-04b3c33e.js} +2 -2
  48. package/dist/es/{ComponentWrapper-4f85a67e.js → ComponentWrapper-bbb717bc.js} +2 -2
  49. package/dist/es/{Container-18b03fde.js → Container-4383c6f0.js} +1 -1
  50. package/dist/es/DataSearch.js +2106 -17
  51. package/dist/es/{DropDown-c8da0a2c.js → DropDown-4edaa621.js} +19 -14
  52. package/dist/es/DynamicRangeSlider.js +68 -26
  53. package/dist/es/{Flex-8770345d.js → Flex-aac91505.js} +1 -1
  54. package/dist/es/{FormControlList-704f8dee.js → FormControlList-fe389a2e.js} +1 -1
  55. package/dist/es/{Input-08bb1bcf.js → Input-d8519224.js} +1 -1
  56. package/dist/es/{ListItem-8e8fb535.js → ListItem-bdb6d53d.js} +2 -2
  57. package/dist/es/MultiDropdownList.js +34 -28
  58. package/dist/es/MultiList.js +43 -32
  59. package/dist/es/MultiRange.js +7 -7
  60. package/dist/es/Pagination-b3e4054a.js +172 -0
  61. package/dist/es/RangeInput.js +13 -9
  62. package/dist/es/RangeSlider.js +7 -7
  63. package/dist/es/ReactiveBase.js +3 -3
  64. package/dist/es/ReactiveComponent.js +34 -64
  65. package/dist/es/ReactiveGoogleMap.js +1756 -0
  66. package/dist/es/ReactiveList.js +66 -231
  67. package/dist/es/ResultCard.js +4 -4
  68. package/dist/es/ResultList.js +4 -4
  69. package/dist/es/SelectedFilters.js +6 -6
  70. package/dist/es/SingleDropdownList.js +28 -22
  71. package/dist/es/SingleList.js +25 -20
  72. package/dist/es/SingleRange.js +7 -7
  73. package/dist/es/StateProvider.js +2 -2
  74. package/dist/es/{Title-3522ff56.js → Title-579f8d6c.js} +1 -1
  75. package/dist/es/ToggleButton.js +7 -7
  76. package/dist/es/{_rollupPluginBabelHelpers-0f24d612.js → _rollupPluginBabelHelpers-ecf6c03c.js} +17 -1
  77. package/dist/es/{index-cb1950b6.js → index-5daa8276.js} +11 -5
  78. package/dist/es/index.js +28 -19
  79. package/dist/es/initReactivesearch.js +99 -82
  80. package/dist/es/install.js +45 -35
  81. package/dist/es/{ssr-a41dfea9.js → ssr-e3196de1.js} +1 -1
  82. package/dist/es/{utils-64a2e5f0.js → utils-3a32e13f.js} +1 -1
  83. package/dist/es/version.js +1 -1
  84. package/dist/es/{vueTypes-687b2304.js → vueTypes-9326e0be.js} +24 -13
  85. package/package.json +86 -80
  86. package/dist/cjs/DataSearch-8658fd8e.js +0 -2154
  87. package/dist/cjs/install-35f74190.js +0 -1196
  88. package/dist/es/DataSearch-66e72d1d.js +0 -2141
  89. package/dist/es/install-ecef1861.js +0 -1189
@@ -0,0 +1,1756 @@
1
+ import { Actions, helper } from '@appbaseio/reactivecore';
2
+ import { a as _extends, d as _inheritsLoose, _ as _taggedTemplateLiteralLoose, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-ecf6c03c.js';
3
+ import VueTypes from 'vue-types';
4
+ import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
5
+ import 'emotion';
6
+ import styled, { css } from '@appbaseio/vue-emotion';
7
+ import 'polished';
8
+ import './Button-799185e2.js';
9
+ import { t as types } from './vueTypes-9326e0be.js';
10
+ import { P as Pagination } from './Pagination-b3e4054a.js';
11
+ import '@appbaseio/reactivecore/lib/utils/transform';
12
+ import 'redux';
13
+ import { h as hasCustomRenderer, i as isQueryIdentical, g as getComponent, a as isFunction, c as connect } from './index-5daa8276.js';
14
+ import { C as ComponentWrapper } from './ComponentWrapper-bbb717bc.js';
15
+ import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
16
+ import { C as Checkbox } from './FormControlList-fe389a2e.js';
17
+ import * as GmapMapFull from 'gmap-vue';
18
+ import Map from 'gmap-vue/dist/components-implementation/map';
19
+ import geohash from 'ngeohash';
20
+ import GmapCluster from 'gmap-vue/dist/components/cluster';
21
+ import InfoWindow from 'gmap-vue/dist/components-implementation/info-window';
22
+ import Marker from 'gmap-vue/dist/components/marker';
23
+ import MapElementMixin from 'gmap-vue/dist/mixins/map-element';
24
+
25
+ var setStreaming = Actions.setStreaming,
26
+ setQueryOptions = Actions.setQueryOptions,
27
+ updateQuery = Actions.updateQuery,
28
+ loadMore = Actions.loadMore,
29
+ setValue = Actions.setValue,
30
+ updateComponentProps = Actions.updateComponentProps,
31
+ setDefaultQuery = Actions.setDefaultQuery,
32
+ recordResultClick = Actions.recordResultClick,
33
+ setMapData = Actions.setMapData;
34
+ var isEqual = helper.isEqual,
35
+ getQueryOptions = helper.getQueryOptions,
36
+ getClassName = helper.getClassName,
37
+ parseHits = helper.parseHits,
38
+ getOptionsFromQuery = helper.getOptionsFromQuery,
39
+ getResultStats = helper.getResultStats; // default map center
40
+
41
+ var MAP_CENTER = {
42
+ lat: 37.7749,
43
+ lng: 122.4194
44
+ };
45
+ var style = {
46
+ width: '100%',
47
+ height: '100vh',
48
+ position: 'relative'
49
+ };
50
+
51
+ function getPrecision(a) {
52
+ if (isNaN(a)) return 0; // eslint-disable-line
53
+
54
+ var e = 1;
55
+ var p = 0;
56
+
57
+ while (Math.round(a * e) / e !== a) {
58
+ e *= 10;
59
+ p += 1;
60
+ }
61
+
62
+ return p;
63
+ }
64
+
65
+ function withDistinctLat(loc, count) {
66
+ var length = getPrecision(loc.lat);
67
+ var noiseFactor = length >= 6 ? 4 : length - 2; // eslint-disable-next-line
68
+
69
+ var suffix = 1 / Math.pow(10, noiseFactor) * count;
70
+
71
+ var location = _extends({}, loc, {
72
+ lat: parseFloat((loc.lat + suffix).toFixed(length))
73
+ });
74
+
75
+ return location;
76
+ }
77
+
78
+ function getLocationObject(location) {
79
+ var resultType = Array.isArray(location) ? 'array' : typeof location;
80
+
81
+ switch (resultType) {
82
+ case 'string':
83
+ {
84
+ if (location.indexOf(',') > -1) {
85
+ var locationSplit = location.split(',');
86
+ return {
87
+ lat: parseFloat(locationSplit[0]),
88
+ lng: parseFloat(locationSplit[1])
89
+ };
90
+ }
91
+
92
+ var locationDecode = geohash.decode(location);
93
+ return {
94
+ lat: locationDecode.latitude,
95
+ lng: locationDecode.longitude
96
+ };
97
+ }
98
+
99
+ case 'array':
100
+ {
101
+ return {
102
+ lat: location[1],
103
+ lng: location[0]
104
+ };
105
+ }
106
+
107
+ default:
108
+ {
109
+ return location;
110
+ }
111
+ }
112
+ }
113
+
114
+ var ReactiveMap = {
115
+ name: 'ReactiveMap',
116
+ props: {
117
+ className: types.string,
118
+ componentId: types.stringRequired,
119
+ dataField: types.stringRequired,
120
+ react: types.react,
121
+ size: types.number,
122
+ sortBy: types.sortBy,
123
+ URLParams: VueTypes.bool,
124
+ autoCenter: VueTypes.bool,
125
+ getMapRef: VueTypes.func.isRequired,
126
+ center: types.location,
127
+ defaultCenter: types.location,
128
+ defaultPin: types.string,
129
+ defaultZoom: VueTypes.number.def(13),
130
+ defaultQuery: types.func,
131
+ innerClass: types.style,
132
+ loader: types.title,
133
+ render: types.func,
134
+ renderItem: types.func,
135
+ renderError: types.title,
136
+ pages: VueTypes.number.def(5),
137
+ currentPage: VueTypes.number.def(0),
138
+ pagination: VueTypes.bool,
139
+ showMarkers: VueTypes.bool,
140
+ defaultSearchAsMove: VueTypes.bool,
141
+ showSearchAsMove: VueTypes.bool,
142
+ defaultRadius: types.number,
143
+ unit: types.string,
144
+ autoClosePopover: VueTypes.bool,
145
+ renderMap: VueTypes.func.isRequired,
146
+ renderPopover: VueTypes.func,
147
+ calculateMarkers: VueTypes.func,
148
+ searchAsMoveLabel: VueTypes.string.def('Search as I move the map')
149
+ },
150
+ preserveCenter: false,
151
+ data: function data() {
152
+ var props = this.$props;
153
+ var currentPageState = 0;
154
+
155
+ if (props.currentPage) {
156
+ currentPageState = Math.max(props.currentPage - 1, 0);
157
+ }
158
+
159
+ this.__state = {
160
+ from: currentPageState * props.size,
161
+ zoom: props.defaultZoom,
162
+ searchAsMove: props.defaultSearchAsMove,
163
+ currentPageState: currentPageState,
164
+ mapBoxBounds: null,
165
+ markersData: null
166
+ };
167
+ return this.__state;
168
+ },
169
+ computed: {
170
+ totalPages: function totalPages() {
171
+ return Math.ceil(this.total / this.$props.size) || 0;
172
+ },
173
+ stats: function stats() {
174
+ var _this$getAllData = this.getAllData(),
175
+ resultsToRender = _this$getAllData.resultsToRender;
176
+
177
+ return _extends({}, getResultStats(this), {
178
+ currentPage: this.currentPageState,
179
+ displayedResults: resultsToRender.length
180
+ });
181
+ },
182
+ hasCustomRender: function hasCustomRender() {
183
+ return hasCustomRenderer(this);
184
+ }
185
+ },
186
+ watch: {
187
+ defaultZoom: function defaultZoom(newVal) {
188
+ this.zoom = newVal;
189
+ },
190
+ currentPage: function currentPage(newVal, oldVal) {
191
+ if (oldVal !== newVal && newVal > 0 && newVal <= this.totalPages) {
192
+ this.setPage(newVal - 1);
193
+ }
194
+ },
195
+ defaultQuery: function defaultQuery(newVal, oldVal) {
196
+ if (!isQueryIdentical(newVal, oldVal, null, this.$props)) {
197
+ var options = getQueryOptions(this.$props);
198
+ options.from = 0;
199
+ this.$defaultQuery = newVal(null, this.$props);
200
+
201
+ var _ref = this.$defaultQuery || {},
202
+ sort = _ref.sort,
203
+ query = _ref.query;
204
+
205
+ if (sort) {
206
+ options.sort = this.$defaultQuery.sort;
207
+ }
208
+
209
+ var queryOptions = getOptionsFromQuery(this.$defaultQuery);
210
+
211
+ if (queryOptions) {
212
+ options = _extends({}, options, getOptionsFromQuery(this.$defaultQuery));
213
+ } // Update calculated default query in store
214
+
215
+
216
+ this.setQueryOptions(this.$props.componentId, options, false);
217
+ var persistMapQuery = true;
218
+ var forceExecute = true; // Update default query to include the geo bounding box query
219
+
220
+ this.setDefaultQueryForRSAPI();
221
+ var meta = {
222
+ mapBoxBounds: this.mapBoxBounds
223
+ };
224
+ this.setMapData(this.componentId, query, persistMapQuery, forceExecute, meta);
225
+ this.currentPageState = 0;
226
+ this.from = 0;
227
+ }
228
+ },
229
+ promotedResults: function promotedResults(newVal, oldVal) {
230
+ if (!isEqual(newVal, oldVal)) {
231
+ this.$emit('data', this.getData());
232
+ }
233
+ },
234
+ hidden: function hidden(newVal, oldVal) {
235
+ if (!isEqual(newVal, oldVal)) {
236
+ this.$emit('data', this.getData());
237
+ }
238
+ },
239
+ time: function time(newVal, oldVal) {
240
+ if (!isEqual(newVal, oldVal)) {
241
+ this.$emit('data', this.getData());
242
+ }
243
+ },
244
+ hits: function hits(newVal, oldVal) {
245
+ this.$emit('data', this.getData());
246
+
247
+ if (this.pagination) {
248
+ // called when page is changed
249
+ if (this.isLoading && (oldVal || newVal)) {
250
+ this.$emit('page-change', this.currentPageState + 1, this.totalPages);
251
+ }
252
+ }
253
+ },
254
+ rawData: function rawData(newVal, oldVal) {
255
+ var _this = this;
256
+
257
+ if (!isEqual(newVal, oldVal)) {
258
+ var promotedResults = this.promotedResults,
259
+ hits = this.hits;
260
+ var results = parseHits(hits) || [];
261
+ var parsedPromotedResults = parseHits(promotedResults) || [];
262
+ var filteredResults = results;
263
+
264
+ if (parsedPromotedResults.length) {
265
+ var ids = parsedPromotedResults.map(function (item) {
266
+ return item._id;
267
+ }).filter(Boolean);
268
+
269
+ if (ids) {
270
+ filteredResults = filteredResults.filter(function (item) {
271
+ return !ids.includes(item._id);
272
+ });
273
+ }
274
+
275
+ filteredResults = [].concat(parsedPromotedResults, filteredResults);
276
+ }
277
+
278
+ filteredResults = filteredResults.filter(function (item) {
279
+ return !!item[_this.dataField];
280
+ }).map(function (item) {
281
+ var _extends2;
282
+
283
+ return _extends({}, item, (_extends2 = {}, _extends2[_this.dataField] = getLocationObject(item[_this.dataField]), _extends2));
284
+ });
285
+ this.filteredResults = this.addNoise(filteredResults);
286
+
287
+ if (this.calculateMarkers) {
288
+ this.markersData = this.calculateMarkers({
289
+ data: this.filteredResults,
290
+ rawData: this.rawData
291
+ }) || [];
292
+ }
293
+
294
+ this.$emit('data', this.getData());
295
+ }
296
+ },
297
+ center: function center(newVal, oldVal) {
298
+ if (!isEqual(newVal, oldVal)) {
299
+ var persistMapQuery = !!this.center; // we need to forceExecute the query because the center has changed
300
+
301
+ var forceExecute = true;
302
+ var geoQuery = this.getGeoQuery(this.$props); // Update default query for RS API
303
+
304
+ this.setDefaultQueryForRSAPI();
305
+ var meta = {
306
+ mapBoxBounds: this.mapBoxBounds
307
+ };
308
+ this.setMapData(this.componentId, geoQuery, persistMapQuery, forceExecute, meta);
309
+ }
310
+ }
311
+ },
312
+ methods: {
313
+ parseLocation: function parseLocation(location) {
314
+ if (Array.isArray(location)) {
315
+ return {
316
+ lat: Number(location[0]),
317
+ lng: Number(location[1])
318
+ };
319
+ }
320
+
321
+ return {
322
+ lat: location ? Number(location.lat) : this.defaultCenter.lat,
323
+ lng: location ? Number(location.lon === undefined ? location.lng : location.lon) : this.defaultCenter.lng
324
+ };
325
+ },
326
+ getDefaultCenter: function getDefaultCenter() {
327
+ if (this.defaultCenter) return this.parseLocation(this.defaultCenter);
328
+ return this.parseLocation(MAP_CENTER);
329
+ },
330
+ addNoise: function addNoise(hits) {
331
+ var _this2 = this;
332
+
333
+ var hitMap = {};
334
+ var updatedHits = [];
335
+ hits.forEach(function (item) {
336
+ var updatedItem = _extends({}, item);
337
+
338
+ var location = _this2.parseLocation(item[_this2.dataField]);
339
+
340
+ var key = JSON.stringify(location);
341
+ var count = hitMap[key] || 0;
342
+ updatedItem[_this2.dataField] = count ? withDistinctLat(location, count) : location;
343
+ updatedHits = [].concat(updatedHits, [updatedItem]);
344
+ hitMap[key] = count + 1;
345
+ });
346
+ return updatedHits;
347
+ },
348
+ getPosition: function getPosition(result) {
349
+ if (result) {
350
+ return this.parseLocation(result[this.dataField]);
351
+ }
352
+
353
+ return null;
354
+ },
355
+ getHitsCenter: function getHitsCenter(hits) {
356
+ var _this3 = this;
357
+
358
+ var data = hits.map(function (hit) {
359
+ return hit[_this3.dataField];
360
+ });
361
+
362
+ if (data.length) {
363
+ var numCoords = data.length;
364
+ var X = 0.0;
365
+ var Y = 0.0;
366
+ var Z = 0.0;
367
+ data.forEach(function (location) {
368
+ if (location) {
369
+ var _lat = 0.0;
370
+ var _lng = 0.0;
371
+ var locationObj = getLocationObject(location);
372
+ _lat = locationObj.lat * Math.PI / 180;
373
+ _lng = (locationObj.lng !== undefined ? locationObj.lng : locationObj.lon) * Math.PI / 180;
374
+ var a = Math.cos(_lat) * Math.cos(_lng);
375
+ var b = Math.cos(_lat) * Math.sin(_lng);
376
+ var c = Math.sin(_lat);
377
+ X += a;
378
+ Y += b;
379
+ Z += c;
380
+ }
381
+ });
382
+ X /= numCoords;
383
+ Y /= numCoords;
384
+ Z /= numCoords;
385
+ var lng = Math.atan2(Y, X); // eslint-disable-next-line
386
+
387
+ var hyp = Math.sqrt(X * X + Y * Y);
388
+ var lat = Math.atan2(Z, hyp);
389
+ var newX = lat * 180 / Math.PI;
390
+ var newY = lng * 180 / Math.PI;
391
+ return {
392
+ lat: newX,
393
+ lng: newY
394
+ };
395
+ }
396
+
397
+ return false;
398
+ },
399
+ getCenter: function getCenter(hits) {
400
+ var _this4 = this;
401
+
402
+ if (this.center) {
403
+ return this.parseLocation(this.center);
404
+ }
405
+
406
+ var mapRef = this.getMapRef();
407
+
408
+ if (mapRef && typeof mapRef.getCenter === 'function' && this.$options.preserveCenter) {
409
+ var currentCenter = mapRef.getCenter();
410
+ setTimeout(function () {
411
+ _this4.$options.preserveCenter = false;
412
+ }, 100);
413
+ return this.parseLocation({
414
+ lat: currentCenter.lat(),
415
+ lng: currentCenter.lng()
416
+ });
417
+ }
418
+
419
+ if (hits && hits.length) {
420
+ if (this.autoCenter) {
421
+ return this.getHitsCenter(hits) || this.getDefaultCenter();
422
+ }
423
+
424
+ return hits[0] && hits[0][this.dataField] ? this.getPosition(hits[0]) : this.getDefaultCenter();
425
+ }
426
+
427
+ return this.getDefaultCenter();
428
+ },
429
+ handleZoomChange: function handleZoomChange(zoom) {
430
+ if (zoom) {
431
+ var prevZoom = this.zoom;
432
+
433
+ if (this.searchAsMove) {
434
+ this.zoom = zoom;
435
+ this.$options.preserveCenter = true;
436
+ this.setGeoQuery(true);
437
+ } else {
438
+ this.zoom = zoom;
439
+ }
440
+
441
+ if (prevZoom !== zoom) {
442
+ this.$emit('zoom-changed', zoom);
443
+ }
444
+ }
445
+ },
446
+ handleOnDragEnd: function handleOnDragEnd() {
447
+ if (this.searchAsMove) {
448
+ this.$options.preserveCenter = true;
449
+ this.setGeoQuery(true);
450
+ }
451
+
452
+ this.$emit('drag-end');
453
+ },
454
+ handlePreserveCenter: function handlePreserveCenter(preserveCenter) {
455
+ this.$options.preserveCenter = preserveCenter;
456
+ },
457
+ handleOnIdle: function handleOnIdle() {
458
+ // only make the geo_bounding query if we have hits data
459
+ if (this.hits && this.hits.length && this.searchAsMove) {
460
+ // always execute geo-bounds query when center is set
461
+ // to improve the specificity of search results
462
+ var executeUpdate = !!this.center;
463
+ this.setGeoQuery(executeUpdate);
464
+ }
465
+
466
+ this.$emit('idle');
467
+ },
468
+ setGeoQuery: function setGeoQuery(executeUpdate) {
469
+ if (executeUpdate === void 0) {
470
+ executeUpdate = false;
471
+ }
472
+
473
+ // execute a new query on the initial mount
474
+ // or whenever searchAsMove is true and the map is dragged
475
+ if (executeUpdate || !this.skipBoundingBox && !this.mapBoxBounds) {
476
+ this.$defaultQuery = this.getGeoQuery();
477
+ var persistMapQuery = !!this.center;
478
+ var forceExecute = this.searchAsMove;
479
+ var meta = {
480
+ mapBoxBounds: this.mapBoxBounds
481
+ };
482
+ this.setMapData(this.componentId, this.$defaultQuery, persistMapQuery, forceExecute, meta);
483
+ }
484
+
485
+ this.skipBoundingBox = false;
486
+ },
487
+ getMapParams: function getMapParams() {
488
+ var _this$getData = this.getData(),
489
+ data = _this$getData.data;
490
+
491
+ var showMarkers = this.showMarkers,
492
+ defaultPin = this.defaultPin,
493
+ renderPopover = this.renderPopover,
494
+ autoClosePopover = this.autoClosePopover,
495
+ renderItem = this.renderItem;
496
+ return {
497
+ resultsToRender: data,
498
+ center: this.getCenter(data),
499
+ getPosition: this.getPosition,
500
+ zoom: this.zoom,
501
+ renderItem: renderItem,
502
+ showMarkers: showMarkers,
503
+ defaultPin: defaultPin,
504
+ renderPopover: renderPopover,
505
+ autoClosePopover: autoClosePopover,
506
+ renderSearchAsMove: this.renderSearchAsMove,
507
+ handlePreserveCenter: this.handlePreserveCenter,
508
+ preserveCenter: this.$options.preserveCenter,
509
+ handleOnDragEnd: this.handleOnDragEnd,
510
+ handleOnIdle: this.handleOnIdle,
511
+ handleZoomChange: this.handleZoomChange
512
+ };
513
+ },
514
+ getAllData: function getAllData() {
515
+ var size = this.size,
516
+ promotedResults = this.promotedResults,
517
+ customData = this.customData,
518
+ currentPage = this.currentPage,
519
+ hits = this.hits;
520
+ var results = parseHits(hits) || [];
521
+ var parsedPromotedResults = parseHits(promotedResults) || [];
522
+ var base = currentPage * size;
523
+ var resultsToRender = this.filteredResults || [];
524
+
525
+ if (this.markersData) {
526
+ resultsToRender = this.markersData;
527
+ }
528
+
529
+ return {
530
+ results: results,
531
+ resultsToRender: resultsToRender,
532
+ customData: customData || {},
533
+ promotedResults: parsedPromotedResults,
534
+ loadMore: this.loadMore,
535
+ base: base,
536
+ triggerClickAnalytics: this.triggerClickAnalytics
537
+ };
538
+ },
539
+ getData: function getData() {
540
+ var _this$getAllData2 = this.getAllData(),
541
+ promotedResults = _this$getAllData2.promotedResults,
542
+ aggregationData = _this$getAllData2.aggregationData,
543
+ customData = _this$getAllData2.customData,
544
+ resultsToRender = _this$getAllData2.resultsToRender;
545
+
546
+ return {
547
+ data: this.withClickIds(resultsToRender),
548
+ aggregationData: this.withClickIds(aggregationData || []),
549
+ promotedData: this.withClickIds(promotedResults),
550
+ rawData: this.rawData,
551
+ resultStats: this.stats,
552
+ customData: customData
553
+ };
554
+ },
555
+ getComponent: function getComponent$1() {
556
+ var error = this.error,
557
+ isLoading = this.isLoading;
558
+
559
+ var data = _extends({
560
+ error: error,
561
+ loading: isLoading,
562
+ loadMore: this.loadMore,
563
+ triggerClickAnalytics: this.triggerClickAnalytics,
564
+ setPage: this.setPage
565
+ }, this.getData());
566
+
567
+ return getComponent(data, this);
568
+ },
569
+ setPage: function setPage(page) {
570
+ // pageClick will be called every time a pagination button is clicked
571
+ if (page !== this.currentPageState) {
572
+ this.$emit('pageClick', page + 1);
573
+ this.$emit('page-click', page + 1);
574
+ var value = this.size * page;
575
+ var options = getQueryOptions(this.$props);
576
+ options.from = this.$data.from;
577
+ this.from = value;
578
+ this.currentPageState = page;
579
+ this.loadMoreAction(this.componentId, _extends({}, options, {
580
+ from: value
581
+ }), false);
582
+
583
+ if (this.URLParams) {
584
+ this.setPageURL(this.componentId, page + 1, this.componentId, false, true);
585
+ }
586
+ }
587
+ },
588
+ setDefaultQueryForRSAPI: function setDefaultQueryForRSAPI() {
589
+ if (this.defaultQuery && typeof this.defaultQuery === 'function') {
590
+ var defaultQuery = this.defaultQuery();
591
+ this.setDefaultQuery(this.componentId, defaultQuery);
592
+ }
593
+ },
594
+ getArrPosition: function getArrPosition(location) {
595
+ return {
596
+ lat: location.lat,
597
+ lon: location.lon || location.lng
598
+ };
599
+ },
600
+ getGeoQuery: function getGeoQuery(props) {
601
+ if (props === void 0) {
602
+ props = this.$props;
603
+ }
604
+
605
+ this.$defaultQuery = props.defaultQuery ? props.defaultQuery() : null;
606
+ var mapRef = this.getMapRef();
607
+ var mapBounds = mapRef && typeof mapRef.getBounds === 'function' ? mapRef.getBounds() : false;
608
+ var north;
609
+ var south;
610
+ var east;
611
+ var west;
612
+
613
+ if (mapBounds) {
614
+ var _geo_bounding_box;
615
+
616
+ north = mapBounds.getNorthEast().lat();
617
+ south = mapBounds.getSouthWest().lat();
618
+ east = mapBounds.getNorthEast().lng();
619
+ west = mapBounds.getSouthWest().lng();
620
+ var boundingBoxCoordinates = {
621
+ top_left: [west, north],
622
+ bottom_right: [east, south]
623
+ };
624
+ this.mapBoxBounds = boundingBoxCoordinates;
625
+ var geoQuery = {
626
+ geo_bounding_box: (_geo_bounding_box = {}, _geo_bounding_box[this.dataField] = boundingBoxCoordinates, _geo_bounding_box)
627
+ };
628
+
629
+ if (this.$defaultQuery) {
630
+ var query = this.$defaultQuery.query;
631
+
632
+ if (query) {
633
+ // adds defaultQuery's query to geo-query
634
+ // to generate a map query
635
+ return {
636
+ must: [geoQuery, query]
637
+ };
638
+ }
639
+ }
640
+
641
+ return geoQuery;
642
+ } // return the defaultQuery (if set) or null when map query not available
643
+
644
+
645
+ return this.$defaultQuery ? this.$defaultQuery.query : null;
646
+ },
647
+ getGeoDistanceQuery: function getGeoDistanceQuery() {
648
+ var center = this.center || this.defaultCenter;
649
+
650
+ if (center && this.defaultRadius) {
651
+ var _geo_distance;
652
+
653
+ // skips geo bounding box query on initial load
654
+ this.skipBoundingBox = true;
655
+ return {
656
+ geo_distance: (_geo_distance = {
657
+ distance: "" + this.defaultRadius + this.unit
658
+ }, _geo_distance[this.dataField] = this.getArrPosition(center), _geo_distance)
659
+ };
660
+ }
661
+
662
+ return null;
663
+ },
664
+ loadMore: function loadMore() {
665
+ if (this.hits && !this.pagination && this.total !== this.hits.length) {
666
+ var value = this.from + this.size;
667
+ var options = getQueryOptions(this.$props);
668
+ this.from = value;
669
+ this.loadMoreAction(this.componentId, _extends({}, options, {
670
+ from: value
671
+ }), true);
672
+ }
673
+ },
674
+ triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
675
+ var docId = documentId;
676
+
677
+ if (!docId) {
678
+ var _this$getData2 = this.getData(),
679
+ data = _this$getData2.data;
680
+
681
+ var hitData = data.find(function (hit) {
682
+ return hit._click_id === searchPosition;
683
+ });
684
+
685
+ if (hitData && hitData._id) {
686
+ docId = hitData._id;
687
+ }
688
+ }
689
+
690
+ this.recordResultClick(searchPosition, docId);
691
+ },
692
+ withClickIds: function withClickIds(results) {
693
+ var _this$getAllData3 = this.getAllData(),
694
+ base = _this$getAllData3.base;
695
+
696
+ return results.map(function (result, index) {
697
+ return _extends({}, result, {
698
+ _click_id: base + index
699
+ });
700
+ });
701
+ },
702
+ toggleSearchAsMove: function toggleSearchAsMove() {
703
+ this.searchAsMove = !this.searchAsMove;
704
+ this.$emit('search-as-move', this.searchAsMove);
705
+ },
706
+ renderErrorComponent: function renderErrorComponent() {
707
+ var renderError = this.$scopedSlots.renderError || this.$props.renderError;
708
+
709
+ if (renderError && this.error && !this.isLoading) {
710
+ return isFunction(renderError) ? renderError(this.error) : renderError;
711
+ }
712
+
713
+ return null;
714
+ },
715
+ renderSearchAsMove: function renderSearchAsMove() {
716
+ var h = this.$createElement;
717
+
718
+ if (this.showSearchAsMove) {
719
+ return h("div", {
720
+ "style": {
721
+ position: 'absolute',
722
+ bottom: '30px',
723
+ left: '10px',
724
+ width: '240px',
725
+ backgroundColor: '#fff',
726
+ padding: '8px 10px',
727
+ boxShadow: 'rgba(0,0,0,0.3) 0px 1px 4px -1px',
728
+ borderRadius: 2,
729
+ zIndex: 10000
730
+ },
731
+ "attrs": {
732
+ "className": getClassName(this.innerClass, 'checkboxContainer') || null
733
+ }
734
+ }, [h(Checkbox, {
735
+ "attrs": {
736
+ "type": "checkbox",
737
+ "id": this.$props.componentId + "-searchasmove",
738
+ "checked": this.searchAsMove,
739
+ "show": true
740
+ },
741
+ "class": getClassName(this.$props.innerClass, 'checkbox'),
742
+ "on": {
743
+ "click": this.toggleSearchAsMove
744
+ }
745
+ }), h("label", {
746
+ "attrs": {
747
+ "className": getClassName(this.innerClass, 'label') || null,
748
+ "for": this.$props.componentId + "-searchasmove"
749
+ }
750
+ }, [this.searchAsMoveLabel])]);
751
+ }
752
+
753
+ return null;
754
+ },
755
+ renderPagination: function renderPagination() {
756
+ var h = this.$createElement;
757
+ return h(Pagination, {
758
+ "attrs": {
759
+ "pages": this.pages,
760
+ "totalPages": this.totalPages,
761
+ "currentPage": this.currentPageState,
762
+ "setPage": this.setPage,
763
+ "innerClass": this.innerClass
764
+ }
765
+ });
766
+ }
767
+ },
768
+ created: function created() {
769
+ if (this.defaultPage >= 0) {
770
+ this.currentPageState = this.defaultPage;
771
+ this.from = this.currentPageState * this.$props.size;
772
+ }
773
+
774
+ this.internalComponent = this.$props.componentId + "__internal";
775
+ this.updateComponentProps(this.componentId, {
776
+ from: this.from
777
+ }, componentTypes.reactiveMap);
778
+ this.updateComponentProps(this.internalComponent, {
779
+ from: this.from
780
+ }, componentTypes.reactiveMap);
781
+ },
782
+ mounted: function mounted() {
783
+ if (this.defaultPage < 0 && this.currentPage > 0) {
784
+ if (this.$props.URLParams) {
785
+ this.setPageURL(this.$props.componentId, this.currentPage, this.$props.componentId, false, true);
786
+ }
787
+ }
788
+
789
+ var options = getQueryOptions(this.$props);
790
+ options.from = this.$data.from;
791
+
792
+ if (this.$props.sortBy) {
793
+ var _ref2;
794
+
795
+ options.sort = [(_ref2 = {}, _ref2[this.$props.dataField] = {
796
+ order: this.$props.sortBy
797
+ }, _ref2)];
798
+ }
799
+
800
+ this.$defaultQuery = null;
801
+
802
+ if (this.$props.defaultQuery) {
803
+ this.$defaultQuery = this.$props.defaultQuery();
804
+ options = _extends({}, options, getOptionsFromQuery(this.$defaultQuery)); // Override sort query with defaultQuery's sort if defined
805
+
806
+ if (this.$defaultQuery.sort) {
807
+ options.sort = this.$defaultQuery.sort;
808
+ } // since we want defaultQuery to be executed anytime
809
+ // map component's query is being executed
810
+
811
+
812
+ var persistMapQuery = true; // no need to forceExecute because setReact() will capture the main query
813
+ // and execute the defaultQuery along with it
814
+
815
+ var forceExecute = false; // Update default query for RS API
816
+
817
+ this.setDefaultQueryForRSAPI();
818
+ var meta = {
819
+ mapBoxBounds: this.mapBoxBounds
820
+ };
821
+ this.setMapData(this.componentId, this.$defaultQuery.query, persistMapQuery, forceExecute, meta);
822
+ } else {
823
+ // only apply geo-distance when defaultQuery prop is not set
824
+ var query = this.getGeoDistanceQuery();
825
+
826
+ if (query) {
827
+ // - only persist the map query if center prop is set
828
+ // - ideally, persist the map query if you want to keep executing it
829
+ // whenever there is a change (due to subscription) in the component query
830
+ var _persistMapQuery = !!this.center; // - forceExecute will make sure that the component query + Map query gets executed
831
+ // irrespective of the changes in the component query
832
+ // - forceExecute will only come into play when searchAsMove is true
833
+ // - kindly note that forceExecute may result in one additional network request
834
+ // since it bypasses the gatekeeping
835
+
836
+
837
+ var _forceExecute = this.searchAsMove; // Set meta for `distance` and `coordinates` in selected value
838
+
839
+ var center = this.center || this.defaultCenter;
840
+ var coordinatesObject = this.getArrPosition(center);
841
+ var _meta = {
842
+ distance: this.defaultRadius,
843
+ coordinates: coordinatesObject.lat + ", " + coordinatesObject.lon
844
+ };
845
+ this.setMapData(this.componentId, query, _persistMapQuery, _forceExecute, _meta);
846
+ }
847
+ }
848
+
849
+ this.setQueryOptions(this.componentId, options, !(this.$defaultQuery && this.$defaultQuery.query));
850
+ },
851
+ render: function render() {
852
+ var h = arguments[0];
853
+ var loader = this.$scopedSlots.loader || this.$props.loader;
854
+ return h("div", {
855
+ "style": _extends({}, style, this.$props.style),
856
+ "class": this.$props.className
857
+ }, [this.renderErrorComponent(), this.isLoading && loader, this.hasCustomRender ? this.getComponent() : null, this.renderMap(this.getMapParams()), this.pagination ? this.renderPagination() : null]);
858
+ }
859
+ };
860
+
861
+ var mapStateToProps = function mapStateToProps(state, props) {
862
+ return {
863
+ defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1 || -1,
864
+ error: state.error[props.componentId],
865
+ isLoading: state.isLoading[props.componentId],
866
+ hits: state.hits[props.componentId] && state.hits[props.componentId].hits,
867
+ promotedResults: state.promotedResults[props.componentId],
868
+ customData: state.customData[props.componentId],
869
+ total: state.hits[props.componentId] && state.hits[props.componentId].total,
870
+ time: state.hits[props.componentId] && state.hits[props.componentId].time,
871
+ rawData: state.rawData[props.componentId],
872
+ hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden
873
+ };
874
+ };
875
+
876
+ var mapDispatchToProps = {
877
+ loadMoreAction: loadMore,
878
+ setPageURL: setValue,
879
+ setQueryOptions: setQueryOptions,
880
+ setStreaming: setStreaming,
881
+ updateQuery: updateQuery,
882
+ updateComponentProps: updateComponentProps,
883
+ setDefaultQuery: setDefaultQuery,
884
+ recordResultClick: recordResultClick,
885
+ setMapData: setMapData
886
+ };
887
+ var RMConnected = ComponentWrapper(connect(mapStateToProps, mapDispatchToProps)(ReactiveMap), {
888
+ componentType: componentTypes.reactiveMap,
889
+ internalComponent: true
890
+ });
891
+
892
+ ReactiveMap.install = function (Vue) {
893
+ Vue.component(ReactiveMap.name, RMConnected);
894
+ }; // Add componentType for SSR
895
+
896
+
897
+ ReactiveMap.componentType = componentTypes.reactiveMap;
898
+
899
+ var InfoWindowWrapper = {
900
+ name: 'InfoWindowWrapper',
901
+ props: {
902
+ id: VueTypes.string,
903
+ renderPopover: VueTypes.func,
904
+ infoWindowProps: VueTypes.object,
905
+ events: VueTypes.object
906
+ },
907
+ data: function data() {
908
+ return {
909
+ infoWindowRef: null
910
+ };
911
+ },
912
+ mounted: function mounted() {
913
+ this.infoWindowRef = this.$refs[this.id + "-Info-Window"];
914
+ },
915
+ methods: {
916
+ handleClose: function handleClose() {
917
+ this.infoWindowRef.$infoWindowObject.close();
918
+ }
919
+ },
920
+ render: function render() {
921
+ var h = arguments[0];
922
+ var renderPopover = this.renderPopover,
923
+ events = this.events;
924
+ return h(InfoWindow, {
925
+ "ref": this.id + "-Info-Window",
926
+ "props": _extends({}, this.infoWindowProps),
927
+ "on": _extends({}, events)
928
+ }, [h("div", [renderPopover(this.handleClose)])]);
929
+ }
930
+ };
931
+
932
+ var MarkerWithLabel = {
933
+ name: 'MarkerWithLabel',
934
+ props: {
935
+ metaData: {
936
+ type: Object,
937
+ "default": undefined
938
+ },
939
+ marker: {
940
+ type: Object,
941
+ "default": undefined
942
+ },
943
+ offsetX: {
944
+ type: Number,
945
+ "default": 0
946
+ },
947
+ offsetY: {
948
+ type: Number,
949
+ "default": 0
950
+ },
951
+ alignment: {
952
+ type: String,
953
+ "default": 'top'
954
+ },
955
+ zIndex: {
956
+ type: Number,
957
+ "default": 50
958
+ },
959
+ cssPosition: {
960
+ type: Boolean,
961
+ "default": false
962
+ },
963
+ renderMarker: VueTypes.func.isRequired,
964
+ handleMouseOver: VueTypes.func,
965
+ handleFocus: VueTypes.func,
966
+ handleMouseOut: VueTypes.func,
967
+ handleBlur: VueTypes.func,
968
+ handleClick: VueTypes.func
969
+ },
970
+ data: function data() {
971
+ return {
972
+ opacity: 0.01
973
+ };
974
+ },
975
+ mixins: [MapElementMixin],
976
+ inject: {
977
+ $clusterPromise: {
978
+ "default": null
979
+ }
980
+ },
981
+ computed: {
982
+ lat: function lat() {
983
+ return parseFloat(Number.isNaN(this.marker.lat) ? this.marker.latitude : this.marker.lat);
984
+ },
985
+ lng: function lng() {
986
+ return parseFloat(Number.isNaN(this.marker.lng) ? this.marker.longitude : this.marker.lng);
987
+ },
988
+ latLng: function latLng() {
989
+ if (this.marker instanceof window.google.maps.LatLng) {
990
+ return this.marker;
991
+ }
992
+
993
+ return new window.google.maps.LatLng(this.lat, this.lng);
994
+ }
995
+ },
996
+ watch: {
997
+ marker: function marker() {
998
+ var _this = this;
999
+
1000
+ this.$mapPromise.then(function () {
1001
+ return _this.$overlay.setPosition();
1002
+ });
1003
+ },
1004
+ zIndex: function zIndex() {
1005
+ if (this.$overlay) {
1006
+ this.$overlay.repaint();
1007
+ }
1008
+ }
1009
+ },
1010
+ beforeCreate: function beforeCreate(options) {
1011
+ if (this.$clusterPromise) {
1012
+ // eslint-disable-next-line
1013
+ options.map = null;
1014
+ }
1015
+
1016
+ return this.$clusterPromise;
1017
+ },
1018
+ destroyed: function destroyed() {
1019
+ if (this.$clusterObject) {
1020
+ this.$clusterObject.removeMarker(this.$overlay, true);
1021
+ } else if (this.$overlay) {
1022
+ this.$overlay.setMap(null);
1023
+ this.$overlay = undefined;
1024
+ }
1025
+ },
1026
+ provide: function provide() {
1027
+ var _this2 = this;
1028
+
1029
+ var self = this;
1030
+ return this.$mapPromise.then(function (map) {
1031
+ var Overlay = /*#__PURE__*/function (_window$google$maps$O) {
1032
+ _inheritsLoose(Overlay, _window$google$maps$O);
1033
+
1034
+ function Overlay(map2) {
1035
+ var _this3;
1036
+
1037
+ _this3 = _window$google$maps$O.call(this) || this;
1038
+ _this3.metaData = self.metaData;
1039
+
1040
+ _this3.setMap(map2);
1041
+
1042
+ _this3.draw = function () {
1043
+ return _this3.repaint();
1044
+ };
1045
+
1046
+ _this3.setPosition = function () {
1047
+ return _this3.repaint();
1048
+ };
1049
+
1050
+ return _this3;
1051
+ }
1052
+
1053
+ var _proto = Overlay.prototype;
1054
+
1055
+ _proto.repaint = function repaint() {
1056
+ var div = self.$el;
1057
+ var projection = this.getProjection();
1058
+
1059
+ if (projection && div) {
1060
+ var posPixel = projection.fromLatLngToDivPixel(self.latLng);
1061
+ var x;
1062
+ var y;
1063
+
1064
+ switch (self.alignment) {
1065
+ case 'top':
1066
+ x = posPixel.x - div.offsetWidth / 2;
1067
+ y = posPixel.y - div.offsetHeight;
1068
+ break;
1069
+
1070
+ case 'bottom':
1071
+ x = posPixel.x - div.offsetWidth / 2;
1072
+ y = posPixel.y;
1073
+ break;
1074
+
1075
+ case 'left':
1076
+ x = posPixel.x - div.offsetWidth;
1077
+ y = posPixel.y - div.offsetHeight / 2;
1078
+ break;
1079
+
1080
+ case 'right':
1081
+ x = posPixel.x;
1082
+ y = posPixel.y - div.offsetHeight / 2;
1083
+ break;
1084
+
1085
+ case 'center':
1086
+ x = posPixel.x - div.offsetWidth / 2;
1087
+ y = posPixel.y - div.offsetHeight / 2;
1088
+ break;
1089
+
1090
+ case 'topleft':
1091
+ case 'lefttop':
1092
+ x = posPixel.x - div.offsetWidth;
1093
+ y = posPixel.y - div.offsetHeight;
1094
+ break;
1095
+
1096
+ case 'topright':
1097
+ case 'righttop':
1098
+ x = posPixel.x;
1099
+ y = posPixel.y - div.offsetHeight;
1100
+ break;
1101
+
1102
+ case 'bottomleft':
1103
+ case 'leftop':
1104
+ x = posPixel.x - div.offsetWidth;
1105
+ y = posPixel.y;
1106
+ break;
1107
+
1108
+ case 'bottomright':
1109
+ case 'rightbottom':
1110
+ x = posPixel.x;
1111
+ y = posPixel.y;
1112
+ break;
1113
+
1114
+ default:
1115
+ throw new Error('Invalid alignment type of custom marker!');
1116
+ }
1117
+
1118
+ if (self.cssPosition) {
1119
+ div.style.transform = "translate(" + (x + self.offsetX) + "px, " + (y + self.offsetY) + "px)";
1120
+ } else {
1121
+ div.style.left = x + self.offsetX + "px";
1122
+ div.style.top = y + self.offsetY + "px";
1123
+ }
1124
+
1125
+ div.style['z-index'] = self.zIndex;
1126
+ }
1127
+ };
1128
+
1129
+ _proto.onAdd = function onAdd() {
1130
+ if (this.$clusterObject) {
1131
+ this.$clusterObject.removeMarker(this.$overlay, true);
1132
+ } else if (this.$overlay) {
1133
+ this.$overlay.setMap(null);
1134
+ this.$overlay = undefined;
1135
+ }
1136
+
1137
+ var div = self.$el;
1138
+ var panes = this.getPanes();
1139
+ div.style.position = 'absolute';
1140
+ div.style.display = 'inline-block';
1141
+ div.style.zIndex = self.zIndex;
1142
+ panes.overlayLayer.appendChild(div);
1143
+ panes.overlayMouseTarget.appendChild(div);
1144
+
1145
+ this.getDraggable = function () {
1146
+ return false;
1147
+ };
1148
+
1149
+ this.getPosition = function () {
1150
+ return new window.google.maps.LatLng(self.lat, self.lng);
1151
+ };
1152
+
1153
+ self.afterCreate(this);
1154
+ } // eslint-disable-next-line
1155
+ ;
1156
+
1157
+ _proto.onRemove = function onRemove() {
1158
+ if (self.$el) {
1159
+ var ua = window.navigator.userAgent;
1160
+ var msie = ua.indexOf('MSIE '); // eslint-disable-next-line
1161
+
1162
+ if (msie > 0 || !!ua.match(/Trident.*rv\:11\./)) {
1163
+ self.$el.parentNode.removeChild(self.$el);
1164
+ } else {
1165
+ self.$el.remove();
1166
+ }
1167
+ }
1168
+ };
1169
+
1170
+ return Overlay;
1171
+ }(window.google.maps.OverlayView);
1172
+
1173
+ _this2.$overlay = new Overlay(map);
1174
+ setTimeout(function () {
1175
+ if (_this2.$overlay) {
1176
+ _this2.$overlay.repaint();
1177
+
1178
+ _this2.opacity = 1;
1179
+ }
1180
+ }, 100);
1181
+ });
1182
+ },
1183
+ methods: {
1184
+ afterCreate: function afterCreate(inst) {
1185
+ var _this4 = this;
1186
+
1187
+ if (this.$clusterPromise && !this.isMarkerAdded) {
1188
+ this.$clusterPromise.then(function (co) {
1189
+ co.addMarker(inst);
1190
+ _this4.$clusterObject = co;
1191
+ _this4.isMarkerAdded = true;
1192
+ });
1193
+ }
1194
+ }
1195
+ },
1196
+ render: function render() {
1197
+ var h = arguments[0];
1198
+ return h("div", {
1199
+ "style": {
1200
+ opacity: this.opacity
1201
+ },
1202
+ "on": {
1203
+ "mouseover": this.handleMouseOver,
1204
+ "mouseout": this.handleMouseOut,
1205
+ "click": this.handleClick
1206
+ }
1207
+ }, [this.renderMarker()]);
1208
+ }
1209
+ };
1210
+
1211
+ var _templateObject, _templateObject2, _templateObject3;
1212
+ var MapPin = styled('div')(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\theight: 24px;\n\twidth: auto;\n\tbackground-color: #fff;\n\tborder-radius: 2px;\n\tcolor: #222;\n\tbox-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.15);\n\tpadding: 3px 6px;\n\tfont-size: 15px;\n"])));
1213
+ var MapPinArrow = styled('div')(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\tborder-color: rgba(0, 0, 0, 0.2);\n\tborder-style: solid;\n\tborder-width: 0 1px 1px 0;\n\tmargin-left: -6px;\n\tbackground-color: #fff;\n\tmargin-top: -6px;\n\twidth: 12px;\n\theight: 12px;\n\t-webkit-transform: rotate(45deg);\n\t-ms-transform: rotate(45deg);\n\ttransform: rotate(45deg);\n"])));
1214
+ var mapPinWrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n\t&:hover,\n\t&:focus {\n\t\tz-index: 200;\n\t}\n"])));
1215
+
1216
+ var recordResultClick$1 = Actions.recordResultClick;
1217
+ var GoogleMapMarker = {
1218
+ name: 'GoogleMapMarker',
1219
+ props: {
1220
+ index: VueTypes.number,
1221
+ marker: VueTypes.object.isRequired,
1222
+ getPosition: VueTypes.func.isRequired,
1223
+ defaultPin: VueTypes.string,
1224
+ renderItem: VueTypes.func,
1225
+ setOpenMarkers: VueTypes.func.isRequired,
1226
+ handlePreserveCenter: VueTypes.func.isRequired,
1227
+ autoClosePopover: VueTypes.bool,
1228
+ openMarkers: VueTypes.object,
1229
+ renderPopover: VueTypes.func,
1230
+ highlightMarkerOnHover: VueTypes.bool
1231
+ },
1232
+ data: function data() {
1233
+ return {
1234
+ zIndex: 0,
1235
+ markerIcon: null
1236
+ };
1237
+ },
1238
+ methods: {
1239
+ increaseMarkerZIndex: function increaseMarkerZIndex() {
1240
+ var handlePreserveCenter = this.$props.handlePreserveCenter;
1241
+
1242
+ if (this.highlightMarkerOnHover) {
1243
+ this.zIndex += 1;
1244
+ }
1245
+
1246
+ handlePreserveCenter(true);
1247
+ },
1248
+ removeMarkerZIndex: function removeMarkerZIndex() {
1249
+ var handlePreserveCenter = this.$props.handlePreserveCenter;
1250
+
1251
+ if (this.highlightMarkerOnHover) {
1252
+ this.zIndex -= 1;
1253
+ }
1254
+
1255
+ handlePreserveCenter(true);
1256
+ },
1257
+ openMarker: function openMarker() {
1258
+ var _ref, _extends2;
1259
+
1260
+ var _this$$props = this.$props,
1261
+ handleOpenMarkers = _this$$props.setOpenMarkers,
1262
+ openMarkers = _this$$props.openMarkers,
1263
+ marker = _this$$props.marker,
1264
+ autoClosePopover = _this$$props.autoClosePopover,
1265
+ handlePreserveCenter = _this$$props.handlePreserveCenter;
1266
+ var id = marker._id;
1267
+ var newOpenMarkers = autoClosePopover ? (_ref = {}, _ref[id] = true, _ref) : _extends({}, openMarkers, (_extends2 = {}, _extends2[id] = true, _extends2));
1268
+ handleOpenMarkers(newOpenMarkers);
1269
+ handlePreserveCenter(true);
1270
+ this.triggerAnalytics();
1271
+ this.$emit('open-marker-popover', marker);
1272
+ },
1273
+ closeMarker: function closeMarker() {
1274
+ var _this$$props2 = this.$props,
1275
+ handleOpenMarkers = _this$$props2.setOpenMarkers,
1276
+ marker = _this$$props2.marker,
1277
+ autoClosePopover = _this$$props2.autoClosePopover,
1278
+ handlePreserveCenter = _this$$props2.handlePreserveCenter,
1279
+ openMarkers = _this$$props2.openMarkers;
1280
+ var id = marker._id;
1281
+
1282
+ var del = openMarkers[id],
1283
+ activeMarkers = _objectWithoutPropertiesLoose(openMarkers, [id].map(_toPropertyKey));
1284
+
1285
+ var newOpenMarkers = autoClosePopover ? {} : activeMarkers;
1286
+ handleOpenMarkers(newOpenMarkers);
1287
+ handlePreserveCenter(true);
1288
+ this.$emit('close-marker-popover', marker);
1289
+ },
1290
+ triggerAnalytics: function triggerAnalytics() {
1291
+ this.recordResultClick(this.index, this.marker._id);
1292
+ },
1293
+ renderPopoverClick: function renderPopoverClick(item, includeExternalSettings) {
1294
+ var _this = this;
1295
+
1296
+ if (includeExternalSettings === void 0) {
1297
+ includeExternalSettings = false;
1298
+ }
1299
+
1300
+ var h = this.$createElement;
1301
+ var additionalProps = {};
1302
+ var _this$$props3 = this.$props,
1303
+ getPosition = _this$$props3.getPosition,
1304
+ _renderPopover = _this$$props3.renderPopover,
1305
+ openMarkers = _this$$props3.openMarkers;
1306
+
1307
+ if (includeExternalSettings) {
1308
+ // to render pop-over correctly with MarkerWithLabel
1309
+ additionalProps = {
1310
+ position: getPosition(item),
1311
+ defaultOptions: {
1312
+ pixelOffset: new window.google.maps.Size(0, -30)
1313
+ }
1314
+ };
1315
+ }
1316
+
1317
+ if (item._id in openMarkers) {
1318
+ return h(InfoWindowWrapper, {
1319
+ "key": item._id + "-InfoWindow",
1320
+ "attrs": {
1321
+ "id": item._id,
1322
+ "renderPopover": function renderPopover(_handleClose) {
1323
+ return _renderPopover({
1324
+ item: item,
1325
+ handleClose: function handleClose() {
1326
+ _handleClose();
1327
+
1328
+ _this.closeMarker();
1329
+ }
1330
+ });
1331
+ },
1332
+ "infoWindowProps": {
1333
+ zIndex: 500,
1334
+ position: additionalProps.position,
1335
+ options: additionalProps.defaultOptions
1336
+ },
1337
+ "events": {
1338
+ closeclick: function closeclick() {
1339
+ return _this.closeMarker();
1340
+ }
1341
+ }
1342
+ }
1343
+ });
1344
+ }
1345
+
1346
+ return null;
1347
+ }
1348
+ },
1349
+ render: function render() {
1350
+ var _this2 = this;
1351
+
1352
+ var h = arguments[0];
1353
+ var _this$$props4 = this.$props,
1354
+ getPosition = _this$$props4.getPosition,
1355
+ renderItem = _this$$props4.renderItem,
1356
+ defaultPin = _this$$props4.defaultPin,
1357
+ renderPopover = _this$$props4.renderPopover,
1358
+ customMarkerProps = _this$$props4.markerProps,
1359
+ marker = _this$$props4.marker;
1360
+ var markerProps = {};
1361
+
1362
+ if (this.zIndex) {
1363
+ markerProps.zIndex = window.google.maps.Marker.MAX_ZINDEX + this.zIndex;
1364
+ }
1365
+
1366
+ if (renderItem) {
1367
+ marker.setIcon = function (icon) {
1368
+ _this2.markerIcon = icon;
1369
+ };
1370
+
1371
+ var data = renderItem(marker);
1372
+
1373
+ if ('label' in data) {
1374
+ return h(MarkerWithLabel, {
1375
+ "key": marker._id,
1376
+ "attrs": {
1377
+ "metaData": marker,
1378
+ "marker": getPosition(marker),
1379
+ "labelAnchor": new window.google.maps.Point(0, 30),
1380
+ "handleMouseOver": this.increaseMarkerZIndex,
1381
+ "handleMouseOut": this.removeMarkerZIndex,
1382
+ "handleClick": this.openMarker,
1383
+ "zIndex": markerProps.zIndex,
1384
+ "renderMarker": function renderMarker() {
1385
+ return h("div", {
1386
+ "attrs": {
1387
+ "css": mapPinWrapper
1388
+ }
1389
+ }, [h(MapPin, [data.label]), h(MapPinArrow), renderPopover ? _this2.renderPopoverClick(marker, true) : null]);
1390
+ }
1391
+ },
1392
+ "props": _extends({}, customMarkerProps)
1393
+ });
1394
+ }
1395
+
1396
+ if ('icon' in data) {
1397
+ markerProps.icon = data.icon;
1398
+ } else {
1399
+ return h(MarkerWithLabel, {
1400
+ "key": marker._id,
1401
+ "attrs": {
1402
+ "metaData": marker,
1403
+ "marker": getPosition(marker),
1404
+ "handleClick": this.openMarker,
1405
+ "handleMouseOver": this.increaseMarkerZIndex,
1406
+ "handleMouseOut": this.removeMarkerZIndex,
1407
+ "zIndex": markerProps.zIndex,
1408
+ "renderMarker": function renderMarker() {
1409
+ return h("div", {
1410
+ "attrs": {
1411
+ "css": mapPinWrapper
1412
+ }
1413
+ }, [typeof data.custom === 'function' ? data.custom(marker) : data.custom, renderPopover ? _this2.renderPopoverClick(marker, true) : null]);
1414
+ }
1415
+ },
1416
+ "props": _extends({}, customMarkerProps)
1417
+ });
1418
+ }
1419
+ } else if (defaultPin) {
1420
+ markerProps.icon = {
1421
+ url: defaultPin
1422
+ };
1423
+ }
1424
+
1425
+ return h(Marker, {
1426
+ "key": marker._id,
1427
+ "attrs": {
1428
+ "zIndex": markerProps.zIndex,
1429
+ "position": getPosition(marker),
1430
+ "options": {
1431
+ metaData: marker
1432
+ },
1433
+ "icon": this.markerIcon || markerProps.icon
1434
+ },
1435
+ "on": {
1436
+ "click": function click() {
1437
+ return _this2.openMarker();
1438
+ },
1439
+ "mouseover": this.increaseMarkerZIndex,
1440
+ "mouseout": this.removeMarkerZIndex
1441
+ },
1442
+ "props": _extends({}, customMarkerProps)
1443
+ }, [renderPopover ? this.renderPopoverClick(marker) : null]);
1444
+ }
1445
+ };
1446
+ var mapDispatchToProps$1 = {
1447
+ recordResultClick: recordResultClick$1
1448
+ };
1449
+ var GoogleMapMarker$1 = connect(function () {
1450
+ return null;
1451
+ }, mapDispatchToProps$1)(GoogleMapMarker);
1452
+
1453
+ var GoogleMapMarkers = {
1454
+ name: 'GoogleMapMarkers',
1455
+ props: {
1456
+ resultsToRender: VueTypes.array,
1457
+ getPosition: VueTypes.func,
1458
+ renderItem: VueTypes.func,
1459
+ renderClusterPopover: VueTypes.func,
1460
+ defaultPin: VueTypes.string,
1461
+ autoClosePopover: VueTypes.bool,
1462
+ handlePreserveCenter: VueTypes.func,
1463
+ renderPopover: VueTypes.func,
1464
+ markerProps: VueTypes.object,
1465
+ clusterProps: VueTypes.object,
1466
+ showMarkerClusters: VueTypes.bool,
1467
+ highlightMarkerOnHover: VueTypes.bool
1468
+ },
1469
+ data: function data() {
1470
+ return {
1471
+ openMarkers: {},
1472
+ clickedCluster: null,
1473
+ clusterMarkers: []
1474
+ };
1475
+ },
1476
+ methods: {
1477
+ setOpenMarkers: function setOpenMarkers(openMarkers) {
1478
+ this.openMarkers = openMarkers;
1479
+ },
1480
+ getClusterMarkers: function getClusterMarkers() {
1481
+ if (this.clickedCluster && Array.isArray(this.clickedCluster.getMarkers())) {
1482
+ return this.clickedCluster.getMarkers().map(function (marker) {
1483
+ return marker.metaData;
1484
+ });
1485
+ }
1486
+
1487
+ return [];
1488
+ },
1489
+ getAdditionalProps: function getAdditionalProps() {
1490
+ return {
1491
+ position: {
1492
+ lat: this.clickedCluster.getCenter().lat(),
1493
+ lng: this.clickedCluster.getCenter().lng()
1494
+ },
1495
+ defaultOptions: {
1496
+ pixelOffset: new window.google.maps.Size(0, -30)
1497
+ }
1498
+ };
1499
+ },
1500
+ closeMarker: function closeMarker() {
1501
+ this.clickedCluster = null;
1502
+ this.clusterMarkers = [];
1503
+ this.$emit('close-cluster-popover');
1504
+ }
1505
+ },
1506
+ render: function render() {
1507
+ var _this = this;
1508
+
1509
+ var h = arguments[0];
1510
+ var resultsToRender = this.$props.resultsToRender;
1511
+ var openMarkers = this.openMarkers;
1512
+ var markerProps = {
1513
+ openMarkers: openMarkers,
1514
+ setMarkerOnTop: this.setMarkerOnTop,
1515
+ setOpenMarkers: this.setOpenMarkers,
1516
+ getPosition: this.getPosition,
1517
+ renderItem: this.renderItem,
1518
+ defaultPin: this.defaultPin,
1519
+ autoClosePopover: this.autoClosePopover,
1520
+ handlePreserveCenter: this.handlePreserveCenter,
1521
+ renderPopover: this.renderPopover,
1522
+ markerProps: this.markerProps,
1523
+ showMarkerClusters: this.showMarkerClusters,
1524
+ highlightMarkerOnHover: this.highlightMarkerOnHover
1525
+ };
1526
+
1527
+ if (this.showMarkerClusters) {
1528
+ return h("div", [h(GmapCluster, {
1529
+ "props": _extends({}, this.clusterProps),
1530
+ "on": {
1531
+ "click": function click(cluster) {
1532
+ _this.clickedCluster = cluster;
1533
+ _this.clusterMarkers = _this.getClusterMarkers();
1534
+
1535
+ _this.$emit('open-cluster-popover', _this.clusterMarkers);
1536
+ }
1537
+ },
1538
+ "ref": "clusterRef"
1539
+ }, [resultsToRender.map(function (marker, index) {
1540
+ return h(GoogleMapMarker$1, {
1541
+ "attrs": {
1542
+ "index": index,
1543
+ "marker": marker
1544
+ },
1545
+ "props": _extends({}, markerProps),
1546
+ "on": _extends({}, _this.$listeners)
1547
+ });
1548
+ })]), this.clickedCluster && this.renderClusterPopover ? h(InfoWindowWrapper, {
1549
+ "attrs": {
1550
+ "id": "cluster",
1551
+ "infoWindowProps": {
1552
+ zIndex: 500,
1553
+ position: this.getAdditionalProps().position,
1554
+ options: this.getAdditionalProps().defaultOptions
1555
+ },
1556
+ "renderPopover": function renderPopover(_handleClose) {
1557
+ return _this.renderClusterPopover({
1558
+ markers: _this.clusterMarkers,
1559
+ cluster: _this.clickedCluster,
1560
+ handleClose: function handleClose() {
1561
+ _handleClose();
1562
+
1563
+ _this.closeMarker();
1564
+ }
1565
+ });
1566
+ },
1567
+ "events": {
1568
+ closeclick: this.closeMarker
1569
+ }
1570
+ }
1571
+ }) : null]);
1572
+ }
1573
+
1574
+ return h("div", [resultsToRender.map(function (marker, index) {
1575
+ return h(GoogleMapMarker$1, {
1576
+ "attrs": {
1577
+ "index": index,
1578
+ "marker": marker
1579
+ },
1580
+ "props": _extends({}, markerProps),
1581
+ "on": _extends({}, _this.$listeners)
1582
+ });
1583
+ })]);
1584
+ }
1585
+ };
1586
+
1587
+ var ReactiveGoogleMap = {
1588
+ name: 'ReactiveGoogleMap',
1589
+ props: {
1590
+ className: types.string,
1591
+ componentId: types.stringRequired,
1592
+ dataField: types.stringRequired,
1593
+ defaultQuery: VueTypes.func,
1594
+ loader: types.title,
1595
+ defaultZoom: VueTypes.number.def(13),
1596
+ react: types.react,
1597
+ size: types.number,
1598
+ sortBy: types.sortBy,
1599
+ URLParams: VueTypes.bool,
1600
+ mapProps: VueTypes.object,
1601
+ showMarkers: VueTypes.bool.def(true),
1602
+ showMarkerClusters: VueTypes.bool.def(false),
1603
+ searchAsMove: VueTypes.bool.def(false),
1604
+ searchAsMoveLabel: VueTypes.string,
1605
+ markerProps: VueTypes.object,
1606
+ clusterProps: VueTypes.object,
1607
+ renderItem: VueTypes.func,
1608
+ showSearchAsMove: VueTypes.bool.def(true),
1609
+ autoClosePopover: VueTypes.bool,
1610
+ pagination: VueTypes.bool,
1611
+ defaultPin: VueTypes.string,
1612
+ autoCenter: VueTypes.bool,
1613
+ defaultCenter: types.location,
1614
+ center: types.location,
1615
+ defaultRadius: types.number,
1616
+ unit: types.string,
1617
+ pages: VueTypes.number.def(5),
1618
+ calculateMarkers: VueTypes.func,
1619
+ highlightMarkerOnHover: VueTypes.bool.def(true)
1620
+ },
1621
+ methods: {
1622
+ renderMap: function renderMap(_ref) {
1623
+ var _this = this;
1624
+
1625
+ var resultsToRender = _ref.resultsToRender,
1626
+ center = _ref.center,
1627
+ zoom = _ref.zoom,
1628
+ handleZoomChange = _ref.handleZoomChange,
1629
+ handleOnDragEnd = _ref.handleOnDragEnd,
1630
+ handleOnIdle = _ref.handleOnIdle,
1631
+ renderSearchAsMove = _ref.renderSearchAsMove,
1632
+ handlePreserveCenter = _ref.handlePreserveCenter,
1633
+ getPosition = _ref.getPosition,
1634
+ autoClosePopover = _ref.autoClosePopover,
1635
+ defaultPin = _ref.defaultPin;
1636
+ var h = this.$createElement;
1637
+ var style = {
1638
+ width: '100%',
1639
+ height: '100%',
1640
+ position: 'relative'
1641
+ };
1642
+ return h("div", {
1643
+ "style": style
1644
+ }, [h(Map, {
1645
+ "ref": "mapRef",
1646
+ "attrs": {
1647
+ "map-type-id": "terrain",
1648
+ "options": {
1649
+ zoomControl: true
1650
+ },
1651
+ "center": center,
1652
+ "zoom": zoom
1653
+ },
1654
+ "style": {
1655
+ height: '100%'
1656
+ },
1657
+ "props": _extends({}, this.mapProps),
1658
+ "on": {
1659
+ "zoom_changed": handleZoomChange,
1660
+ "dragend": handleOnDragEnd,
1661
+ "idle": handleOnIdle
1662
+ }
1663
+ }, [this.showMarkers ? h(GoogleMapMarkers, {
1664
+ "attrs": {
1665
+ "resultsToRender": resultsToRender,
1666
+ "getPosition": getPosition,
1667
+ "markerProps": this.markerProps,
1668
+ "clusterProps": this.clusterProps,
1669
+ "handlePreserveCenter": handlePreserveCenter,
1670
+ "highlightMarkerOnHover": this.highlightMarkerOnHover,
1671
+ "renderItem": this.$scopedSlots.renderItem ? function () {
1672
+ return {
1673
+ custom: _this.$scopedSlots.renderItem
1674
+ };
1675
+ } : this.renderItem,
1676
+ "defaultPin": defaultPin,
1677
+ "autoClosePopover": autoClosePopover,
1678
+ "renderPopover": this.$scopedSlots.renderPopover,
1679
+ "renderClusterPopover": this.$scopedSlots.renderClusterPopover,
1680
+ "showMarkerClusters": this.showMarkerClusters
1681
+ },
1682
+ "on": _extends({}, this.$listeners)
1683
+ }) : null]), renderSearchAsMove()]);
1684
+ },
1685
+ getMapRef: function getMapRef() {
1686
+ return this.mapRef;
1687
+ }
1688
+ },
1689
+ mounted: function mounted() {
1690
+ var _this2 = this;
1691
+
1692
+ if (this.$refs.mapRef) {
1693
+ this.$refs.mapRef.$mapPromise.then(function (map) {
1694
+ _this2.mapRef = map;
1695
+ });
1696
+ }
1697
+ },
1698
+ render: function render() {
1699
+ var h = arguments[0];
1700
+ return h(RMConnected, _mergeJSXProps([{
1701
+ "attrs": {
1702
+ "getMapRef": this.getMapRef,
1703
+ "renderMap": this.renderMap,
1704
+ "componentId": this.componentId,
1705
+ "className": this.className,
1706
+ "dataField": this.dataField,
1707
+ "defaultZoom": this.defaultZoom,
1708
+ "react": this.react,
1709
+ "size": this.size,
1710
+ "sortBy": this.sortBy,
1711
+ "pagination": this.pagination,
1712
+ "uRLParams": this.URLParams,
1713
+ "defaultSearchAsMove": this.searchAsMove,
1714
+ "showSearchAsMove": this.showSearchAsMove,
1715
+ "searchAsMoveLabel": this.searchAsMoveLabel,
1716
+ "showMarkers": this.showMarkers,
1717
+ "markerProps": this.markerProps,
1718
+ "autoClosePopover": this.autoClosePopover,
1719
+ "defaultPin": this.defaultPin,
1720
+ "defaultQuery": this.defaultQuery,
1721
+ "autoCenter": this.autoCenter,
1722
+ "defaultCenter": this.defaultCenter,
1723
+ "defaultRadius": this.defaultRadius,
1724
+ "unit": this.unit,
1725
+ "pages": this.pages,
1726
+ "center": this.center,
1727
+ "loader": this.loader,
1728
+ "calculateMarkers": this.calculateMarkers
1729
+ }
1730
+ }, {
1731
+ scopedSlots: this.$scopedSlots,
1732
+ on: this.$listeners
1733
+ }]));
1734
+ }
1735
+ };
1736
+
1737
+ ReactiveGoogleMap.install = function (Vue, options) {
1738
+ Vue.component(ReactiveGoogleMap.name, ReactiveGoogleMap);
1739
+
1740
+ if (!options || !options.key) {
1741
+ console.error('ReactiveSearch: map key is required to use ReactiveGoogleMap component');
1742
+ }
1743
+
1744
+ Vue.use(GmapMapFull, {
1745
+ load: {
1746
+ key: options.key,
1747
+ libraries: 'places'
1748
+ },
1749
+ installComponents: false
1750
+ });
1751
+ }; // Add componentType for SSR
1752
+
1753
+
1754
+ ReactiveGoogleMap.componentType = componentTypes.reactiveMap;
1755
+
1756
+ export default ReactiveGoogleMap;