ionic-team / ionic-native-google-maps

Google maps plugin for Ionic Native
Other
221 stars 125 forks source link

Fix Encoding.decodePath() not working or not been released #258

Closed asarrabay closed 4 years ago

asarrabay commented 4 years ago

I'm submitting a ... (check one with "x")

If you choose 'problem or bug report', please select OS: (check one with "x")

package.json:

        "@ionic-native/core": "5.13.0",
        "@ionic-native/google-maps": "5.5.0",

Current behavior: I have the same issue than #138 :

When I call Encoding.decodePath() I have an error :

ERROR TypeError: Cannot read property 'decodePath' of undefined
    at Function.push.../../node_modules/@ionic-native/google-maps/ngx/index.js.Encoding.decodePath (index.js:773)

node_modules/@ionic-native/google-maps/ngx/index.js:

/* ... */
    Encoding.decodePath = function (encoded, precision) {
        if (checkAvailability(GoogleMaps.getPluginRef(), null, GoogleMaps.getPluginName()) === false) {
            throw new Error('cordova-plugin-googlemaps is not ready. Please use platform.ready() before accessing this method.');
        }
        return GoogleMaps.getPlugin().encoding.decodePath(encoded, precision);
    };

/* ... */
        return GoogleMaps.getPlugin().encoding.encodePath(path);
/* ... */

Expected behavior: Returns ILatLng[]

Fix:

The commit which fix this bug seems not to be include in the last release (The last release on your repository is from January and the commit is from April).