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.
- Use hook um_user_location_after_location_field_set_by_autocomplete to change the location field after autocomplete.
- Use hook um_user_location_formatted_address_set_by_geocode to change the location field after geocode.
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 zooming on the map using a mouse scroll wheel.
Example 03 #
- Set default center and restrict the map bounds.
- Set default zoom and restrict the map to minimum and maximum zoom.
Example 04 #
- Disable clustering.
Example 05 #
- Use Map ID.
Example 06 #
- Replace the full address with the city name on autocomplete.
- Replace the full address with the city name on geocode.
Related Maps JavaScript API documentation: