I would like to call a function straight out of core-ajax - is that possible??
I have two search fields each with a 'currentLocation' button. When the button is clicked, it requests the current location (lat, lng) from the browser (getGeoLocation) and sends lat, lng and output-SearchField to the core-ajax.
It then should display the formatted address in the search field close to where the button was clicked.
(I can catch the results from the php file with addEvent Listener fine but in the process, I loose the search field where it should be displayed.)
Here my code, sorry still struggling my way through but I really like the potential of Polymer.
<core-ajax
id="getAddressFromLatLng"
auto
url="php-include/phpAddressFromLatLong.php"
method="POST"
params='{"lat":"51.339", "lng":"12.373", "SearchField":""}'
handleAs="json"
on-core-response= "function(){
console.log(response);
document.getElementById("SearchField").value = response.detail.response;
}">
</core-ajax>
Thanks for your help and comments.