I am using leaflet.js and this plugin: https://github.com/stefanocudini/leaflet-search and need a way of getting the lat and long coordinates from the address search and putting them into an input field, or just being able to use them...
The answer may well be in the code below, just can't figure out how to do it...
var geocoder = new google.maps.Geocoder();
function googleGeocoding(text, callResponse)
{
geocoder.geocode({address: text}, callResponse);
}
function filterJSONCall(rawjson)
{
var json = {},
key, loc, disp = [];
for(var i in rawjson)
{
key = rawjson[i].formatted_address;
loc = L.latLng( rawjson[i].geometry.location.lat(), rawjson[i].geometry.location.lng() );
json[ key ]= loc; //key,value format
}