You are here

function leaflet_widget_geojson_feature in Leaflet Widget for Geofield 7

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

File

./leaflet_widget.module, line 257

Code

function leaflet_widget_geojson_feature($wkt, $properties = array()) {
  $geophp = geophp_load();
  if (!$geophp) {
    return FALSE;
  }
  $geometry = geoPHP::load($wkt, 'wkt');
  return array(
    'type' => 'Feature',
    'geometry' => json_decode($geometry
      ->out('json')),
    'properties' => $properties,
  );
}