function geocoder_mapquest_nominatim in Geocoder 7
Process Markup.
1 call to geocoder_mapquest_nominatim()
- geocoder_mapquest_nominatim_field in plugins/
geocoder_handler/ mapquest_nominatim.inc - Plugin callback.
1 string reference to 'geocoder_mapquest_nominatim'
- mapquest_nominatim.inc in plugins/
geocoder_handler/ mapquest_nominatim.inc
File
- plugins/
geocoder_handler/ mapquest_nominatim.inc, line 29
Code
function geocoder_mapquest_nominatim($address, $options = array()) {
$geocoder_settings = variable_get('geocoder_settings', array());
$api_url = 'http://open.mapquestapi.com/nominatim/v1/search';
$params = array(
'format' => 'json',
'addressdetails' => 0,
'limit' => 1,
'osm_type' => 'N',
'key' => $geocoder_settings['geocoder_apikey_mapquest'],
);
$request = drupal_http_request($api_url . '?q=' . urlencode($address) . '&' . drupal_http_build_query($params));
$data = json_decode($request->data);
return _geocoder_mapquest_nominatim_geometry($data);
}