3
0
Fork 0
mirror of https://github.com/farmOS/farmOS.git synced 2024-02-23 11:37:38 +01:00

Add a map for displaying all farm areas.

This commit is contained in:
Michael Stenta 2015-07-22 23:20:37 -04:00
parent ae78932d5e
commit 34dabbfb89
3 changed files with 66 additions and 0 deletions

View file

@ -0,0 +1,61 @@
<?php
/**
* @file
* farm_area.default_openlayers_maps.inc
*/
/**
* Implements hook_default_openlayers_maps().
*/
function farm_area_default_openlayers_maps() {
$export = array();
$ol_map = new stdClass();
$ol_map->disabled = FALSE; /* Edit this to true to make a default ol_map disabled initially */
$ol_map->api_version = 1;
$ol_map->machine_name = 'farm_areas';
$ol_map->name = 'Farm Areas';
$ol_map->description = '';
$ol_map->factory_service = 'openlayers.Map:OLMap';
$ol_map->options = array(
'width' => 'auto',
'height' => '400px',
'view' => array(
'center' => array(
'lat' => -96,
'lon' => 40,
),
'rotation' => 0,
'zoom' => 4,
'minZoom' => 0,
'maxZoom' => 0,
'limit_extent' => 0,
'extent' => '-194.765625, -57.32652122521709, 21681210.199033674, 7827151.696402048',
),
'renderer' => 'canvas',
'layers' => array(
0 => 'farm_areas',
),
'sources' => array(
0 => 'views_geojson_farm_areas_geojson_feed',
1 => 'farm_map_google_hybrid',
),
'controls' => array(
0 => 'openlayers_control_fullscreen',
1 => 'openlayers_control_zoom',
2 => 'openlayers_control_scaleline',
),
'components' => array(
0 => 'farm_area_component_areas_zoom_to_source',
1 => 'farm_area_component_area_details_popup',
),
'interactions' => array(
0 => 'openlayers_interaction_doubleclickzoom',
1 => 'openlayers_interaction_dragpan',
2 => 'openlayers_interaction_mousewheelzoom',
),
);
$export['farm_areas'] = $ol_map;
return $export;
}

View file

@ -14,6 +14,9 @@ function farm_area_ctools_plugin_api($module = NULL, $api = NULL) {
if ($module == "openlayers" && $api == "default_openlayers_layers") {
return array("version" => "1");
}
if ($module == "openlayers" && $api == "default_openlayers_maps") {
return array("version" => "1");
}
if ($module == "strongarm" && $api == "strongarm") {
return array("version" => "1");
}

View file

@ -23,6 +23,7 @@ dependencies[] = views_geojson
dependencies[] = views_tree
features[ctools][] = openlayers:default_openlayers_components:1
features[ctools][] = openlayers:default_openlayers_layers:1
features[ctools][] = openlayers:default_openlayers_maps:1
features[ctools][] = strongarm:strongarm:1
features[ctools][] = views:views_default:3.0
features[features_api][] = api:2
@ -35,6 +36,7 @@ features[field_instance][] = taxonomy_term-farm_areas-field_farm_images
features[openlayers_components][] = farm_area_component_area_details_popup
features[openlayers_components][] = farm_area_component_areas_zoom_to_source
features[openlayers_layers][] = farm_areas
features[openlayers_maps][] = farm_areas
features[taxonomy][] = farm_areas
features[variable][] = pathauto_taxonomy_term_farm_areas_pattern
features[views_view][] = farm_areas