Show map in /locations and /asset/[id]/locations

Created on 13 August 2015, over 9 years ago
Updated 30 October 2023, about 1 year ago

New issue summary (for farmOS v2):

Add a map to the /locations path, as well as the /asset/[id]/locations path.

Original issue summary (from farmOS v1):

When viewing a single area (the taxonomy term view page, technically speaking), you currently see a map with only the selected area's polygon in it. The rest of the farm areas are shown as gray polygons underneath, but you can't click on them. It would be nice if the child areas were displayed inside the parent when viewing the parent - and could be clicked on in the same way as the main farm map.

Consideration: when viewing an area, it may not always be obvious which polygon is the parent, and which is the child. One solution to this would be to make the stroke/outline of the parent thicker, so it's more prominently highlighted.

Also: this means that all of the included polygon areas (parent and child) will be rendered twice in the map - because they are also being rendered for the gray "all areas" layer underneath them. Perhaps the solution to that is to add a contextual filter to the "all areas" polygon View so that they can be excluded.

✨ Feature request
Status

Active

Version

3.0

Component

Farm Areas

Created by

πŸ‡ΊπŸ‡ΈUnited States m.stenta

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States m.stenta
  • πŸ‡ΊπŸ‡ΈUnited States m.stenta

    I opened a pull request that does the first part of this: https://github.com/farmOS/farmOS/pull/779

    This PR takes the first, simplest, and most impactful step towards [Issue #2551091: Show map in /locations and /asset/[id]/locations]( https://www.drupal.org/project/farm/issues/2551091 β†’ ).

    It adds a map of locations to the /locations page in farmOS.

    It does NOT add a map of locations to the /asset/[id]/locations pages. This has additional complexity, and I don't think there's a lot of value in taking this first step, and tackling the second part in a follow-up.

    This PR also makes another general change, which is to rename/replace the current dashboard map type a locations map type (and also cleans up some dependencies). The thought behind this change is that the current dashboard map type is not dashboard-specific at all (other than the fact that it's only used on the dashboard). It is provided by the farm_ui_map module, not the farm_ui_dashboar` module, and it adds layers for all locations to the map. So this just generalizes that to be more reusable, and then uses it in the /location page.

    If we merge that, then I think we can rename this issue to focus on the next step of adding maps to /asset/[id]/locations pages.

  • πŸ‡ΊπŸ‡ΈUnited States m.stenta

    If we merge that, then I think we can rename this issue to focus on the next step of adding maps to /asset/[id]/locations pages.

    I took a quick look at what will be needed for this. The main complexity is that we generate the geometry layers in our farm_asset_geojson View. We will need to be able to contextually filter those Views based on a parent asset ID. This is not currently possible with current Views handlers (that I'm aware of). I think we will need to code our own custom contextual filter for it.

    Once we have that contextual filter in place, we can add an option to our asset_type_layers behavior that allows it to pass a parent asset ID into the Views contextual filter. Then we can use that new option in LocationHierarchyForm and it should "just work"!

  • Status changed to Needs work 11 months ago
  • πŸ‡ΊπŸ‡ΈUnited States m.stenta
  • πŸ‡ΊπŸ‡ΈUnited States m.stenta
Production build 0.71.5 2024