User Locations - Hooks

The view and controls of the map may be customized with these hooks:

  • Use hook um_user_locations_marker_data to change the map marker.
  • Use hook um_user_locations_map_args_init to customize the map on the Members page.
  • Use hook um_user_locations_map_field_args_init to customize the map on the Profile page.
  • Use hook um_member_directory_disable_clustering to disable clustering.

See examples below.

You can add a code snippet to the functions.php file in the active theme directory. Skip the opening <?php tag.

Example 01 #

  • Change the map marker title.
  • Replace the map marker image.

Example 02 #

  • Set default zoom.
  • Disable the Zoom control.
  • Disable disables zooming on the map using a mouse scroll wheel.

Example 03 #

  • Set default zoom.
  • Restrict the map to minimum and maximum zoom.
  • Disable the Map type control.
  • Disable the Street View function.

Example 04 #

  • Disable clustering.

Example 05 #

  • Use Map ID.

Related Maps JavaScript API documentation: