Add areas layer to geofield maps.

This commit is contained in:
Michael Stenta 2015-07-30 23:00:44 -04:00
parent ac1895508e
commit 35dd8cac98
1 changed files with 13 additions and 0 deletions

View File

@ -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');
}
}
}