You are here

function leaflet_widget_widget_prepare_items in Leaflet Widget for Geofield 7

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

File

./leaflet_widget.module, line 142

Code

function leaflet_widget_widget_prepare_items($items) {
  $features = array();
  foreach ($items as $item) {
    if (isset($item['wkt'])) {
      $features[] = leaflet_widget_geojson_feature($item['wkt']);
    }
  }
  return leaflet_widget_geojson_feature_collection($features);
}