Skip to content

Commit

Permalink
Issue #2551091: Show map on /locations
Browse files Browse the repository at this point in the history
  • Loading branch information
mstenta committed Jan 20, 2024
1 parent 3f16b0d commit 0d88c57
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/core/ui/location/farm_ui_location.info.yml
Expand Up @@ -6,5 +6,6 @@ core_version_requirement: ^10
dependencies:
- farm:farm_entity
- farm:farm_location
- farm:farm_ui_map
- farm:farm_ui_menu
- inspire_tree:inspire_tree
11 changes: 11 additions & 0 deletions modules/core/ui/location/src/Form/LocationHierarchyForm.php
Expand Up @@ -112,6 +112,17 @@ public function getTitle(AssetInterface $asset = NULL) {
*/
public function buildForm(array $form, FormStateInterface $form_state, AssetInterface $asset = NULL) {

// If no asset was specified, show a map of all locations.
if (is_null($asset)) {
$form['map'] = [
'#type' => 'farm_map',
'#map_type' => 'blank',
'#behaviors' => [
'locations',
],
];
}

// Add a DIV for the JavaScript content.
$form['content'] = [
'#type' => 'html_tag',
Expand Down

0 comments on commit 0d88c57

Please sign in to comment.