etodanik / ion-google-place

Ionic directive for a location dropdown that utilizes google maps
MIT License
251 stars 201 forks source link

bug fixes and enhancements #10

Open ivanst-stoyanov opened 9 years ago

ivanst-stoyanov commented 9 years ago
  1. Implemented config options.
  2. Configured the directive to use AutocompleteService instead of Geocoder.
  3. Fixed an issue with scrolling.
  4. The directive now can be called multiple times from the same view.
etodanik commented 9 years ago

The tabbing difference totally freaked out the diff here to show almost every single line as different. I'll take a look at the meat of your fixes and try to merge that.

Could you help me with that and point out the lines where important stuff is?

ivanst-stoyanov commented 9 years ago

Sorry about that. Visual Studio and Resharper must have done it. The lines with changes (in the new file) are: 21, 23-26, 29-46, 64, 81, 92-96. The lines in the old file (removed code) are: 17, 34, 51, 61-65, 74-76, 91-93.

loomtronic commented 9 years ago

Wasn't sure if it was appropriate to submit a PR that's just an edit of someone else's work, but if it is helpful then I will... feel free to give me any feed back @ivanst-stoyanov

loomtronic commented 9 years ago

The other issue with this is that if the user is not displaying a map on the page, not showing the google logo might be an issue with their display requirements... https://developers.google.com/maps/documentation/javascript/places#LogoRequirements

While this is in the javascript docs, the texts seem to not mention the API and seem more universal

'If your application displays Places API data on a map, that map must be provided by Google.

If your application displays Places API data on a page or view that does not also display a Google Map, you must show a "Powered by Google" logo with that data. For example, if your application displays a list of places on one tab, and a Google Map with those places on another tab, the first tab must show the "Powered by Google" logo.'

EDIT:

Changing the list template to include the logo shows it on load and at the bottom of the auto complete results

'<ion-content class="has-header has-header">',
                                '<ion-list>',
                                    '<ion-item ng-repeat="location in locations" type="item-text-wrap" ng-click="selectLocation(location)">',
                                        '{{location.description}}',
                                    '</ion-item>',
                                    '<ion-item><img src="https://maps.gstatic.com/mapfiles/api-3/images/powered-by-google-on-white2.png"></ion-item>',
                                '</ion-list>',
'</ion-content>',
aas1226 commented 9 years ago

Thanks @loomtronic it fixed most of my problems