@kizmann/pico-js 0.3.8 → 0.3.9

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": "@kizmann/pico-js",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "author": "Eduard Kizmann <kizmann@protonmail.ch>",
@@ -404,6 +404,13 @@ export default class Map
404
404
  }
405
405
 
406
406
  setMarkerByAddress(key, address)
407
+ {
408
+ return this.getLocationByAddress(key, address, (res) => {
409
+ this.setMarkerPosition(key, Obj.get(res, '0.geometry.location', {}));
410
+ });
411
+ }
412
+
413
+ getLocationByAddress(key, address, callback = null)
407
414
  {
408
415
  let geocoderService = new global.google.maps.Geocoder();
409
416
 
@@ -412,7 +419,7 @@ export default class Map
412
419
  let geocoderResult = (response, status) => {
413
420
 
414
421
  if ( status === 'OK' ) {
415
- this.setMarkerPosition(key, Obj.get(response, '0.geometry.location', {}));
422
+ callback(response);
416
423
  resolve(response);
417
424
  }
418
425