You are here

function _geocoder_mapbox_geometry in Geocoder 7

Plugin callback.

1 call to _geocoder_mapbox_geometry()
geocoder_mapbox in plugins/geocoder_handler/mapbox.inc
Process Markup.

File

plugins/geocoder_handler/mapbox.inc, line 76

Code

function _geocoder_mapbox_geometry(&$data) {
  if (!isset($data->features)) {
    return NULL;
  }
  elseif (isset($data->features[0]->geometry->type) && $data->features[0]->geometry->type === 'Point') {
    return new Point($data->features[0]->geometry->coordinates[0], $data->features[0]->geometry->coordinates[1]);
  }
}