From 35dd8cac9841a85fa44049675fcdc909425facec Mon Sep 17 00:00:00 2001 From: Michael Stenta Date: Thu, 30 Jul 2015 23:00:44 -0400 Subject: [PATCH] Add areas layer to geofield maps. --- farm_area.default_openlayers_maps.inc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/farm_area.default_openlayers_maps.inc b/farm_area.default_openlayers_maps.inc index 7a169e2b..540070d8 100644 --- a/farm_area.default_openlayers_maps.inc +++ b/farm_area.default_openlayers_maps.inc @@ -57,3 +57,16 @@ function farm_area_default_openlayers_maps() { return $export; } + +/** + * Implements hook_default_openlayers_maps_alter(). + */ +function farm_area_default_openlayers_maps_alter(&$maps) { + + // Add areas layer to farm_geofield* maps. + foreach ($maps as &$map) { + if (substr($map->machine_name, 0, 17) == 'farm_map_geofield') { + array_unshift($map->options['layers'], 'farm_area_layer_areas'); + } + } +}