Directory Maps

Map mode turns a roster into a picture of where everyone is. A directory of certified installers becomes a coverage map. A members-only meetup group becomes a cluster of pins you can zoom into. Under the hood it's Leaflet or MapLibre, OpenStreetMap-based tiles, and member addresses geocoded to coordinates. This page covers the whole chain: the fields that collect geography, the geocoder that turns addresses into coordinates, and the map the member sees.

How map mode loads

A map directory renders a lightweight container plus inline JSON configuration. The markers themselves are fetched client-side from an AJAX endpoint after the page loads, which keeps the page HTML identical for every visitor and safe for full-page caching. Set the mode on the directory (display="map") or per embed:

[memb_directory slug="installers" display="map"]
A map directory: member markers on a street map with zoom controls and a layer switcher in the corner

Geo fields: collecting usable geography

A map is only as good as its addresses. Free-text address fields geocode poorly ("Springfield" matches thirty cities). The directory module ships sourced geography field types for the form builder: country, region, and postal code, backed by bundled datasets for the US, UK, Canada, and Australia. Members pick from validated lists instead of typing, and postal codes store truncated to the prefix the geocoder can actually use.

Add these fields to your signup or profile form and map directories will have clean geography to plot. Existing free-text data can be normalized in bulk from the admin (the geo normalize tool rewrites values into the sourced format).

Geocoding

Geocoding turns "90210" into latitude and longitude. The default provider is Nominatim, the OpenStreetMap geocoder, with no API key required. Nominatim's usage policy bans bulk lookups, so Torii queues geocode requests and feeds them to the provider at a polite rate instead of firing them all at once.

The Directory Settings screen controls this: the geocode provider, an API key field for providers that need one, and the toggle for external geocoding (off by default; when off, no lookups are sent to an outside service at all).

The Directory Settings screen: geocode provider, API key, external geocoding toggle, and map tile options

Resolved coordinates are cached locally, so a member's position is geocoded once, not on every page load. The cache can be prewarmed or cleared from the admin, and a resync tool recomputes member counts and membership rows if the roster and the map ever disagree.

Configuring the map

Each map directory has its own map settings in the Directory Settings metabox: renderer (Leaflet or MapLibre), zoom level, map height, and a cap on the number of markers rendered (protects the browser when a directory has thousands of members). Which member fields supply the marker position (latitude, longitude, and the text shown in the marker popup) is also set here, so two directories can plot different fields from the same profiles.

Tiles come from presets: OpenStreetMap (standard), Esri Satellite, and Esri Light Gray for a minimal look, or a custom tile URL with your own attribution. Members switch layers from the control in the corner of the map.

Privacy on maps

A member can opt out of the map specifically: hidden from maps but still listed in grid and list views. That control lives on their profile (see Directory Privacy). Directory-level access rules apply the same as any other mode.

Hooks for developers

The map view is filterable at every seam: map/classes for the container, map/popup/before and map/popup/after to wrap marker popups, plus the general directory filters (card_html, field_value, and friends) documented on the memb_directory page.