etodanik / ion-google-place

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

Being able to display a default list at opening #7

Closed QuentinFchx closed 9 years ago

QuentinFchx commented 9 years ago

Use case: I'd like to display the last places that the user selected when they "open" the widget.

We could pass a list of location to the directive through an attribute and init scope.locations with it. I will come with a PR tomorrow !

QuentinFchx commented 9 years ago

Finally, my use-case will be too specific to be implemented here. I'll fork. Thanks for the library tho ! :)

etodanik commented 9 years ago

What is your use case? I don't think that a default list of locations is too specific. That sounds like a great feature

QuentinFchx commented 9 years ago

I wanted to store the n lasts locations that the user selected, and to display them each time they start a new search.

I started my own implementation: I use the localStorage to store them and it causes the following issue: Google wrap its geometry.location property into a LatLng object and it's obviously lost when you store it. To fix this, I instantiate another LatLng each time I retrieve the history from the localStorage but I think this is too specific for this library.

etodanik commented 9 years ago

I see. Yeah, with this kind of side effect it's a bit too much.