etodanik / ion-google-place

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

Places support and ability to limit what comes up in a search. #76

Closed petekeller2 closed 8 years ago

petekeller2 commented 8 years ago

Potential to cause problems for some users:
Use of http requests
Having the placeholder only being updated if it is set to the .description
(from UPDATES.md)
Has the options of searching for places now
Requires ion-google-place element to have google-key. (google-key="your key")
Option of search-type in ion-google-place element (geocode, address, establishment, (cities), or (regions))
Placeholder now must be the ng-model dot description to be displayed. (if ng-model is address, placeholder ={{address.description}})

jakeywan commented 8 years ago

Hey Pete, this looks very promising, thanks a lot. I tried implementing it and the http requests are giving me CORS errors. Any idea how to avoid that? Thanks!

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '[my local server]' is therefore not allowed access.

petekeller2 commented 8 years ago

Either cross origin resource sharing has to be enabled or you can use the server-side-code-required branch of my fork instead. I recommend the second option. If you want to improve the first option, use the Google Maps JavaScript API instead of the Google Places API Web Service. I missed the note in the documentation that that library is for server usage. I'll try to fix that when I get some free time to do so.

jakeywan commented 8 years ago

Hmm interesting. I sort of moved on and coded it myself, but I ended up using the places API and didn't have any issues with CORS, and I'm doing it client side. Not sure what the difference is...

Sent from my iPhone

On Mar 27, 2016, at 3:01 PM, Peter Keller notifications@github.com wrote:

Either cross origin resource sharing has to be enabled or you can use the server-side-code-required branch of my fork instead. I recommend the second option. If you want to improve the first option, use the Google Maps JavaScript API instead of the Google Places API Web Service. I missed the note in the documentation that that library is for server usage. I'll try to fix that when I get some free time to do so.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub