Closed cchvuth closed 5 years ago
this.map.one(GoogleMapsEvent.MAP_READY).then(() => {
Encoding.decodePath('...');
});
this.map.one(GoogleMapsEvent.MAP_READY).then(() => { Encoding.decodePath('...'); });
It returns the same error
this.map = GoogleMaps.create('map_canvas', {
camera: {
target: {
lat: this.lat,
lng: this.lon
},
zoom: 18,
tilt: 30
}
})
this.map.one(GoogleMapsEvent.MAP_READY).then(() => {
Encoding.decodePath('o|qeAe}b_StkQirVcwXztA??~bVlcW')
});
Unfortunately, I'm terrible busy this week. You need to wait until I'm ready, or please inspect by yourself.
Unfortunately, I'm terrible busy this week. You need to wait until I'm ready, or please inspect by yourself.
It used to work correctly around 5 months ago, now the same code doesn't work anymore, even on non-beta version (tried on ionic 3 and ionic 4)
It's working with @ionic-native/google-maps@4.8.2 but not with 4.9 and latest beta
Good job 👍 Find out the problem position, then could you send a pull request?
So, I found out that v4.14.0 works as well. I compared the node module and see that on line 2474 of @ionic-native/google-maps/index.js (v4.15.1), you put GoogleMaps.getPlugin().Encoding.decodePath(encoded, precision);
When I change this line to GoogleMaps.getPlugin().geometry.encoding.decodePath(encoded, precision);
it works like a charm.
Thank you for pointing out. I fixed the code.
Hey the code still isn't fixed from what I can tell. You changed it to:
Partial / Incorrect Fix:
return GoogleMaps.getPlugin().encoding.decodePath(encoded, precision);
- just making 'e' lowercase, you still need to add the '.geometry.e' part like cchvuth pointed out.
Full Fix:
return GoogleMaps.getPlugin().geometry.encoding.decodePath(encoded, precision);
Got lost for a while after applying your changes, decided to console log the .getPlugin() call and noticed encoding is inside geometry object. Anyway I might be wrong, I'm still new to trying to understand complex code.
In order to contribute, please send a pull request.
This issue is still with us in version 5.5.0. Only GoogleMaps.getPlugin().geometry.encoding.decodePath(encoded) works.
I'm submitting a ... (check one with "x")
If you choose 'problem or bug report', please select OS: (check one with "x")
cordova information: (run
$> cordova plugin list
)If you use
@ionic-native/google-maps
, please tell the package.json (only@ionic-native/core
and@ionic-native/google-maps
are fine mostly)Current behavior:
import { Encoding } from '@ionic-native/google-maps'; Encoding.decodePath('o|qeAe}b_StkQirVcwXztA??~bVlcW') Result: TypeError: Cannot read property 'decodePath' of undefined at Function.push../node_modules/@ionic-native/google-maps/index.js.Encoding.decodePath (index.js:741)
Expected behavior: Returns ILatLng[]
Related code, data or error log (please format your code or data): https://cchvuth@bitbucket.org/cchvuth/tj-ionic-4.git