pigochu/yii2-jquery-locationpicker

Custom Expression

deshario opened this issue · 5 comments

How can I get the more values by custom expression ... Currently i can access only latitude and longtitude .... I had print the object in console that gets from onchanged ... it has only latitude and longtitude ... I'm trying to access more data such as full address .. How can i do that ? #Thankx

new1
new2

You can not get searchBox value from server ?

I think you could create a hidden input , than implement js onsubmit event and copy searchbox value to your hidden input.

If you want to get more info from server. you can use Geocoding API .
https://developers.google.com/maps/documentation/geocoding/intro.

you can also read how to Binding UI with the widget , than implement inputBinding map to your hidden input.
http://logicify.github.io/jquery-locationpicker-plugin/

@deshario
in onchanged event , you can use addressComponents.
var addressComponents = $(this).locationpicker('map').location.addressComponents;

There are only 4-5 attributes that can be accessible from addressComponents ... It will be great if we can access full address. Thankx

@deshario

I dont understand fulladdress what you want , but I can get full address from formattedAddress.

image