neo.mjs 4.7.4 → 4.7.5

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": "neo.mjs",
3
- "version": "4.7.4",
3
+ "version": "4.7.5",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -9,6 +9,10 @@ import Observable from '../../core/Observable.mjs';
9
9
  * @singleton
10
10
  */
11
11
  class GoogleMaps extends Base {
12
+ /**
13
+ * @member {google.maps.Geocoder|null} maps=null
14
+ */
15
+ geoCoder = null
12
16
  /**
13
17
  * @member {Object} maps={}
14
18
  */
@@ -36,6 +40,7 @@ class GoogleMaps extends Base {
36
40
  app: [
37
41
  'addMarker',
38
42
  'create',
43
+ 'geocode',
39
44
  'hideMarker',
40
45
  'panTo',
41
46
  'removeMap',
@@ -125,6 +130,24 @@ class GoogleMaps extends Base {
125
130
  me.fire('mapCreated', id);
126
131
  }
127
132
 
133
+ /**
134
+ * Use either address, location or placeId
135
+ * @param {Object} data
136
+ * @param {String} data.address
137
+ * @param {Object} data.location
138
+ * @param {String} data.placeId
139
+ * @returns {Object}
140
+ */
141
+ async geocode(data) {
142
+ let me = this;
143
+
144
+ if (!me.geoCoder) {
145
+ me.geoCoder = new google.maps.Geocoder();
146
+ }
147
+
148
+ return await me.geoCoder.geocode(data);
149
+ }
150
+
128
151
  /**
129
152
  * @param {Object} data
130
153
  * @param {String} data.id