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
| Setting | Type | Environment | Purpose |
|---|---|---|---|
marker_source_type |
select | per-button | wp_category / gd_listings / custom |
marker_source_id |
text | per-button | Category id / GD post type / custom slug |
default_zoom |
number | per-button | Initial zoom level (1–20) |
default_lat |
text | global | Fallback latitude when GeoIP fails |
default_lon |
text | global | Fallback longitude |
show_user_location |
yes-no | global | If on, app requests location permission |
marker_icon |
image | per-button | Icon used for each marker |
style_* |
various | per-button | Colors |
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 class consumes geofilter_default_name and the geofilter radius from the JSON payload.
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
default_lat/default_lon. - Search radius defaults differ between the initial query (100) and subsequent queries (25). The role-scoped setting
tsl-setting-geofilter_radiusoverrides the default;?radius=on the request overrides everything (capped at 3000). - 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 |
