Primary responsibility
Renders a geographic map with markers. Markers come from:
- A configured WP post type (post category)
- A GeoDirectory post type (when mam-geodirectory is active)
- Any sibling plugin contributing markers via
mam_get_phone_data_before_sendat the right priority
Settings
The Map content class is a thin shell — it declares no app_settings() of its own and get_data_for_app() passes the category through unchanged. Map behavior is driven by global app settings owned by the app-settings registry (and by the markers sibling plugins contribute). The relevant global settings include:
| Setting | Type | Environment | Purpose |
|---|---|---|---|
geofilter_default_lat / default_lat |
text | global | Fallback latitude (map center when GeoIP is unavailable) |
geofilter_default_lon / default_lon |
text | global | Fallback longitude |
default_map_zoom |
number | global | Initial map zoom level |
center_map_on_user |
yes-no | global | Center the map on the user’s location |
map_show_categories |
yes-no | global | Show the category filter on the map |
map_show_table |
yes-no | global | Show the list/table alongside the map |
map_title |
text | global | Map screen title |
map_show_tip / map_tip_title / map_tip_message |
yes-no / text | global | First-run map tip callout |
use_map_marker_images |
yes-no | global | Render custom marker images instead of default pins |
JSON shape (marker)
{
"id": "123",
"title": "Venue name",
"lat": "40.7128",
"lon": "-74.0060",
"marker_icon": "https://...",
"snippet": "Short description"
}
lat/lon are strings (frozen — older mobile parsers reject numeric coordinates).
Hooks involved
The Map content class doesn’t fire dedicated hooks. Markers are usually contributed by sibling plugins:
- mam-geodirectory:
mam_geodirectory_explcit_listings,mam_geodirectory_final_listings,mam_gd_events_exclude_from_map - mam-special-offers:
mam_specials_get_post_lat,mam_specials_get_post_lon,mam_specials_get_post_radius - mam-geofilters: contributes per-region marker subsets
The map center falls back to the tsl-setting-geofilter_default_lat / tsl-setting-geofilter_default_lon global settings, and the search radius comes from the request (see the radius gotcha below).
Gotchas
lat/lonare strings. Don’t emit numeric values — older mobile parsers fail.- Default coords are global, not per-button. All maps in the app share the
tsl-setting-geofilter_default_lat/tsl-setting-geofilter_default_longlobal settings. - Search radius comes from the request. The app passes
?radius=on the phone-data request; mam-main persists it to the_geofilter_radiususermeta key. A couple of legacy normalizations apply:radius=0is coerced to50, andradius=500is coerced to5000. - Map rendering is the mobile client’s job. mam-main provides the markers; the app uses a native map view (Apple Maps / Google Maps depending on platform and config).
Related articles
- Content classes overview
- Hook: mam_get_phone_data_before_send
- Mobile JSON shape
Metadata
| Field | Value |
|---|---|
| Article type | Screen Reference |
| Plugin slug | mam-main |
| Applies to plugin version | 2.1.11+ |
| Category | App Settings Reference |
| Audience | WordPress admin / PHP developer |
| Class name | local_app_map (frozen) |
| Source file | includes/content-classes/local-app-map-class.php |
| Last verified | 2026-05-02 |
