You are here

function leaflet_widget_process_geojson in Leaflet Widget for Geofield 7

Same name and namespace in other branches
  1. 7.2 leaflet_widget.module \leaflet_widget_process_geojson()
1 call to leaflet_widget_process_geojson()
leaflet_widget_widget_validate in ./leaflet_widget.module

File

./leaflet_widget.module, line 171

Code

function leaflet_widget_process_geojson($geojson) {
  $geom = geoPHP::load($geojson, 'json');
  $type = $geom
    ->geometryType();
  $result = array(
    'wkt' => $geom
      ->out('wkt'),
  );
  geofield_compute_values($result, 'wkt');
  return $result;
}