Geocoder does not work on the browser platform (ionic platform add browser && ionic run browser)
ionic info output
Cordova CLI: 6.3.1
Ionic Framework Version: 2.1.0
Ionic CLI Version: 2.2.0
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v7.6.0
Xcode version: Not installed
Using ionic-native 2.9.0
Code sample:
let req: GeocoderRequest = { address: 'some query' }
Geocoder.geocode( req ).then( results => {
//something
})
.catch( error => {
console.error( error );
})
'results' is always an empty array, and the console outputs
'Error: exec proxy not found for :: Geocoder :: geocode'
is it possible to use in the browser environment?
It's not supposed to work on browser platform. The Geocoder class is part of the google maps plugin, which only supports Android and iOS platforms.
The other plugin we have is NativeGeocoder, which also only supports iOS/Android.
If you use Ionic Native v3 you will be able to override the class provider and write your own browser functionality for it.
@ihadeed thanks for the reply.
I would only suggest that this information (the supported platforms) could be added to the docs/readme.
Most helpful comment
It's not supposed to work on browser platform. The
Geocoderclass is part of the google maps plugin, which only supports Android and iOS platforms.The other plugin we have is NativeGeocoder, which also only supports iOS/Android.
If you use Ionic Native v3 you will be able to override the class provider and write your own browser functionality for it.