I tried to do a decodePath on an encoded path using Ionic native googlemaps (cordova-plugin-googlemaps) in an Ionic 3 app. However, the function returns undefined. Here’s my code:
import { Encoding } from "@ionic-native/google-maps";
...
console.log("decoded path", Encoding.decodePath('{~|mAyquxMhEyF'));
I’m using the cordova-plugin-googlemaps 2.2.0-beta-20180117-2320 (multiple maps version) of the plugin.
Is there something wrong that I’m doing in the above code to get undefined as the response from decodePath method?
Why don’t you try to fix the problem of ionic-native, and send it as a pull request?
Source code is fully open, and everybody can send PRs.
Contribute each other, that’s the true open source.
I’m face the same problem, and tried your solution. But now I get the following error:
core.js:1350 ERROR TypeError: Cannot read property 'geometry' of null
at Function.webpackJsonp.49.Encoding.decodePath (index.js:1357)
at StationPage.webpackJsonp.181.StationPage.ionViewWillEnter (station.ts:32)
at ViewController._lifecycle (view-controller.js:486)
at ViewController._willEnter (view-controller.js:384)
at Tab.NavControllerBase._willEnter (nav-controller-base.js:780)
at nav-controller-base.js:673
at t.invoke (polyfills.js:3)
at Object.onInvoke (core.js:4629)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
The line that produces the problem is the return of decodePath: