Skip to content

Add native squaremap integration - #1463

Open
mercurialmusic wants to merge 3 commits into
Zrips:masterfrom
BadWolfMC:squaremap-integration
Open

Add native squaremap integration#1463
mercurialmusic wants to merge 3 commits into
Zrips:masterfrom
BadWolfMC:squaremap-integration

Conversation

@mercurialmusic

Copy link
Copy Markdown

This PR adds native squaremap integration to Residence, following the structure of the existing Dynmap, BlueMap, and Pl3xMap integrations.

The implementation:

  • Adds squaremap-api as an optional, provided dependency.
  • Registers squaremap as a soft dependency.
  • Adds a SquareWebMap adapter using squaremap’s marker API.
  • Displays each Residence area as a two-dimensional X/Z rectangle.
  • Supports multiple areas, subzones, configured subzone depth, and multiple worlds.
  • Respects the existing Residence webmap configuration, including colors, borders, opacity, visibility lists, HideByDefault, and HideHidden.
  • Uses Residence’s existing event-driven webmap update system rather than periodic polling.
  • Uses safe marker keys for Residence and area names containing unsupported characters.
  • Avoids retaining squaremap MapWorld instances and safely handles replacement world registrations.
  • Refreshes surviving webmap markers after an individual Residence area is deleted.

The integration has been built and tested on a server with Residence and squaremap, including marker creation, updates, removal, hidden residences, subzones, multiple areas, and plugin shutdown cleanup.

Existing behavior noted during review

While reviewing the shared webmap lifecycle, a few pre-existing behaviors were identified that are outside the intended scope of this PR:

  • Reloading the Residence configuration may create additional webmap adapter/listener instances without disabling the previous instances.
  • Renaming an individual area or subzone does not appear to fire the same rename event used for top-level Residences, which may leave an older webmap marker key until the layer is otherwise refreshed.

These behaviors affect the shared webmap system rather than squaremap specifically and are not addressed here to keep this PR focused on the new integration.

Thank you for the consideration.

Closes #1443

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Natively support squaremap

1 participant