Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
139 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
modules/core/ui/location/config/install/farm_map.map_type.locations.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
langcode: en | ||
status: true | ||
dependencies: | ||
enforced: | ||
module: | ||
- farm_ui_location | ||
id: locations | ||
label: Locations | ||
description: 'The farmOS locations map.' | ||
behaviors: | ||
- locations | ||
options: { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Post update functions for farm_ui_location module. | ||
*/ | ||
|
||
use Drupal\farm_map\Entity\MapType; | ||
|
||
/** | ||
* Add farmOS locations map type. | ||
*/ | ||
function farm_ui_location_post_update_add_locations_map_type(&$sandbox = NULL) { | ||
|
||
// Create locations map type. | ||
$map_type = MapType::create([ | ||
'id' => 'locations', | ||
'label' => 'Locations', | ||
'description' => 'The farmOS locations map.', | ||
'behaviors' => [ | ||
'location', | ||
], | ||
'options' => [], | ||
'dependencies' => [ | ||
'enforced' => [ | ||
'module' => [ | ||
'farm_ui_location', | ||
], | ||
], | ||
], | ||
]); | ||
$map_type->save(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
modules/core/ui/map/config/install/farm_map.map_behavior.locations.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
langcode: en | ||
status: true | ||
dependencies: | ||
enforced: | ||
module: | ||
- farm_ui_map | ||
id: locations | ||
label: Location asset layers | ||
description: 'Displays location asset geometries in layers by asset type.' | ||
library: '' | ||
settings: { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,4 @@ dependencies: | |
- farm:asset | ||
- farm:farm_location | ||
- farm:farm_map | ||
- farm:farm_ui_dashboard | ||
- farm:farm_ui_views |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Post update functions for farm_ui_map module. | ||
*/ | ||
|
||
use Drupal\farm_map\Entity\MapBehavior; | ||
use Drupal\farm_map\Entity\MapType; | ||
|
||
/** | ||
* Create farmOS-map locations behavior, add it to dashboard map. | ||
*/ | ||
function farm_ui_map_post_update_locations_behavior(&$sandbox = NULL) { | ||
|
||
// Create locations behavior. | ||
$behavior = MapBehavior::create([ | ||
'id' => 'locations', | ||
'label' => 'Location asset layers', | ||
'description' => 'Displays location asset geometries in layers by asset type.', | ||
'library' => '', | ||
'settings' => [], | ||
'dependencies' => [ | ||
'enforced' => [ | ||
'module' => [ | ||
'farm_ui_map', | ||
], | ||
], | ||
], | ||
]); | ||
$behavior->save(); | ||
|
||
// Add the locations behavior to the dashboard map type. | ||
$dashboard = MapType::load('dashboard'); | ||
$behaviors = $dashboard->getMapBehaviors(); | ||
$behaviors[] = 'locations'; | ||
$dashboard->set('behaviors', $behaviors); | ||
$dashboard->save(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters