User Locations - Hooks

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

  • Use hook um_member_directory_disable_clustering to disable clustering.
  • Use hook um_user_locations_marker_data to change the map marker title.
  • 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.

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 #

  • Disable clustering.
  • Change the map marker title.

Example 02 #

  • Set default zoom.
  • Disable the ability to pan and zoom the map.
  • Disable gestures on the map.

Example 03 #

  • Set default zoom.
  • Restrict the map to minimum and maximum zoom.
  • Disable gestures on the map.
  • Disable the Street View function.

Related Maps JavaScript API documentation: