Content class: Map

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_send at 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:

The Map class consumes geofilter_default_name and the geofilter radius from the JSON payload.


Gotchas

  • lat/lon are 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_radius overrides 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).

  • 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
Contents

    Need Support?

    Can’t find the answer you’re looking for? Don’t worry we’re here to help!