From 52b5afd75d7eb982195b5b4b979d95e37a385182 Mon Sep 17 00:00:00 2001 From: Michael Stenta Date: Thu, 23 Jul 2015 01:18:00 -0400 Subject: [PATCH] Add a layer for Google Hybrid. --- farm_map.default_openlayers_layers.inc | 28 ++++++++++++++++++++++++++ farm_map.default_openlayers_maps.inc | 2 ++ farm_map.features.inc | 3 +++ farm_map.info | 2 ++ 4 files changed, 35 insertions(+) create mode 100644 farm_map.default_openlayers_layers.inc diff --git a/farm_map.default_openlayers_layers.inc b/farm_map.default_openlayers_layers.inc new file mode 100644 index 00000000..f39f6e69 --- /dev/null +++ b/farm_map.default_openlayers_layers.inc @@ -0,0 +1,28 @@ +disabled = FALSE; /* Edit this to true to make a default ol_layer disabled initially */ + $ol_layer->api_version = 1; + $ol_layer->machine_name = 'farm_map_google_hybrid'; + $ol_layer->name = 'Farm Map: Google Hybrid'; + $ol_layer->description = ''; + $ol_layer->factory_service = 'openlayers.Layer:Tile'; + $ol_layer->options = array( + 'source' => 'farm_map_google_hybrid', + 'visible' => 1, + 'opacity' => 1, + ); + $export['farm_map_google_hybrid'] = $ol_layer; + + return $export; +} diff --git a/farm_map.default_openlayers_maps.inc b/farm_map.default_openlayers_maps.inc index e7d6f3a5..d6c2e803 100644 --- a/farm_map.default_openlayers_maps.inc +++ b/farm_map.default_openlayers_maps.inc @@ -35,6 +35,7 @@ function farm_map_default_openlayers_maps() { ), 'layers' => array( 0 => 'geofield_field_formatter_layer', + 1 => 'farm_map_google_hybrid', ), 'controls' => array( 0 => 'openlayers_control_fullscreen', @@ -81,6 +82,7 @@ function farm_map_default_openlayers_maps() { ), 'layers' => array( 0 => 'geofield_field_formatter_layer', + 1 => 'farm_map_google_hybrid', ), 'controls' => array( 0 => 'openlayers_control_fullscreen', diff --git a/farm_map.features.inc b/farm_map.features.inc index 94a8d268..40e92952 100644 --- a/farm_map.features.inc +++ b/farm_map.features.inc @@ -11,6 +11,9 @@ function farm_map_ctools_plugin_api($module = NULL, $api = NULL) { if ($module == "openlayers" && $api == "default_openlayers_components") { return array("version" => "1"); } + if ($module == "openlayers" && $api == "default_openlayers_layers") { + return array("version" => "1"); + } if ($module == "openlayers" && $api == "default_openlayers_maps") { return array("version" => "1"); } diff --git a/farm_map.info b/farm_map.info index 7c0bce5b..ead0b325 100644 --- a/farm_map.info +++ b/farm_map.info @@ -8,11 +8,13 @@ dependencies[] = geofield dependencies[] = openlayers dependencies[] = openlayers_geofield features[ctools][] = openlayers:default_openlayers_components:1 +features[ctools][] = openlayers:default_openlayers_layers:1 features[ctools][] = openlayers:default_openlayers_maps:1 features[ctools][] = openlayers:default_openlayers_sources:1 features[features_api][] = api:2 features[field_base][] = field_farm_geofield features[openlayers_components][] = farm_map_component_geofield_zoom_to_source +features[openlayers_layers][] = farm_map_google_hybrid features[openlayers_maps][] = farm_map_geofield features[openlayers_maps][] = farm_map_geofield_formatter features[openlayers_sources][] = farm_map_google_hybrid