ionic-team / ionic-native-google-maps

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

rename fields to google #184

Closed alexwar closed 5 years ago

alexwar commented 5 years ago

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)

cordova-plugin-add-swift-support 1.7.1 "AddSwiftSupport"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 2.0.1 "Device"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-transfer 1.6.0 "File Transfer"
cordova-plugin-filepath 1.0.2 "FilePath"
cordova-plugin-googlemaps 2.5.2 "cordova-plugin-googlemaps"
cordova-plugin-inappbrowser 2.0.1 "InAppBrowser"
cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview"
cordova-plugin-network-information 1.3.4 "Network Information"
cordova-plugin-photo-library 2.1.0 "Photo Library"
cordova-plugin-splashscreen 4.1.0 "Splashscreen"
cordova-plugin-sqlite-2 1.0.4 "SQLitePlugin"
cordova-plugin-statusbar 2.4.1 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
cordova-sqlite-storage 2.6.0 "Cordova sqlite storage plugin"
cordova-universal-clipboard 0.1.0 "Clipboard"
es6-promise-plugin 4.2.2 "Promise"

If you use @ionic-native/google-maps, please tell the package.json (only @ionic-native/core and @ionic-native/google-maps are fine mostly) @ionic-native/google-maps: 4.21.0 @ionic-native/core:3.14.0 Current behavior:

1)code duplication 110 - 115

        if (!result.country && addrComp.types.indexOf('country') > -1) {
          result.country = addrComp.long_name;
          result.countryCode = addrComp.short_name;
        }
        if (!result.postalCode && addrComp.types.indexOf('postal_code') > -1) {
          result.postalCode = addrComp.long_name;
        }
        if (!result.postalCode && addrComp.types.indexOf('postal_code') > -1) {
          result.postalCode = addrComp.long_name;
        }
        if (!result.thoroughfare && addrComp.types.indexOf('street_address') > -1) {
          result.thoroughfare = addrComp.long_name;
        }

2)field renaming in google Api route matches long or short name of a route. locality matches against locality and sublocality types. administrativeArea matches all the levels of administrative area. postalCode matches postal codes and postal code prefixes. country matches a country name or a two letter ISO 3166-1 country code. Note: The API follows the ISO standard for defining countries, and the filtering works best when using the corresponding ISO code of the country.

        if (!result.thoroughfare && addrComp.types.indexOf('street_address') > -1) {
          result.thoroughfare = addrComp.long_name;
        }

Expected behavior:

1)I just saw an error when debugging 2)I expected to find the full address from google api a "formatted_address". Screen capture or video record: image Related code, data or error log (please format your code or data):

Geocoder.geocode({ address: 'Универмаг белгород'}).then( value=>{ 
  console.error(value);
})
alexwar commented 5 years ago

I accidentally created ionic-native @ / google-maps and not cordova-plugin-googlemaps, I apologize