Skip to content

Import map resources as groups and layers in GeoNode catalog #12511

Description

@allyoucanmap

Description

Extend the GeoNode catalog so selecting a map resource imports the layers/group content into the current map: all of the map's layers, preserving its group hierarchy, nested under a new parent group named after the map (background layers should be excluded).

Mixed selections keep working in a single add: datasets become one layer each, documents become one vector layer, maps become layers + groups.

Example: 1 dataset + 1 map (4 layers in 2 groups) produces 1 dataset layer + 4 map layers grouped under a new map title parent group.

This uses the catalog processRecords API, which returns { layers, groups } and lets a service expand one selected record into multiple layers and groups; the container applies groups before layers.

Acceptance criteria

  • A GeoNode catalog service can include map in its resource types, and maps appear in the results list.
  • Selecting a map and adding it imports the map's layers into the current TOC, preserving the map's group hierarchy, nested under a single new parent group named after the map.
  • Imported layers/groups get fresh ids so they never collide with layers/groups already in the current map.
  • Per-layer/group configuration from the saved map config are preserved; map-level view (center/zoom) and background are ignored on import.
  • Mixed selection (datasets + documents + maps) adds all of them in one operation.
  • Selecting multiple maps creates one parent group per map.
  • Unit tests cover the map branch of processRecords and the re-homing logic.

Other useful information

Implementation outline

  • processRecords (api/catalog/GeoNode.js) gains a map branch routing maps to a new buildMapContent(record, options); the method still returns { layers, groups }.
  • buildMapContent (utils/GeoNodeUtils.js): fetch the full map by pk if needed, read data.map.layers/data.map.groups, create a fresh parent group (id = uuid(), title = record.title), re-id and re-home every layer/group under it, and return { layers, groups }

Metadata

Metadata

Assignees

Labels

New Featureused for new functionalities

Fields

No fields configured for New Feature.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions