Maps Marker Pro Hooks documentation

back to API overview

Maps Marker Pro Hooks documentation

  1. Introduction
  2. Map Texts Filters
  3. Map Settings Filters
  4. Map Content Filter (mmp_map_content)


Introduction

Maps Marker Pro includes many WordPress hooks which can be utilized by developers to modify the behaviour of Maps Marker Pro. Currently we added many WordPress filters that can be used to modify texts and settings of Maps Marker Pro maps on frontend. In the future we plan to add more filters and actions. Maps Marker Pro hooks are supported since v2.7+


Map texts filters

Dynamically change the texts of MapsMarker Pro maps.

Chosen Filter Example

  • mmp_text_directions

    To change the 'Directions' text on the map.

Usage


<?php
add_filter('mmp_text_directions', 'change_directions_text');
function change_directions_text($directions_text){
    return __('Get Directions','my-text-domain');
}


Parameters

  • $directions_text string

    Defaults to 'Directions'.


Source Code

This filter is located in inc/showmap.php

Complete list of map texts filters

Filter Functionality Parameter/s Default value Source Code
mmp_text_directions To change the 'Directions' text on the map. $directions_text string "Directions" inc/showmap.php
mmp_text_export_kml To change the text of Export to Google Maps icon title on the map. $export_kml_text string "Export as KML for Google Earth/Google Maps" inc/showmap.php
mmp_text_fullscreen To change the text of fullscreen icon title on the map. $fullscreen_text string "Open standalone map in fullscreen mode" inc/showmap.php
mmp_text_georss To change the text of GeoRSS icon title on the map. $georss_text string "Export as GeoRSS" inc/showmap.php
mmp_text_wikitude To change the text of wikitude icon title on the map. $wikitude_text string "Export as ARML for Wikitude Augmented-Reality browser" inc/showmap.php
mmp_text_qr To change the text of QR icon title on the map. $qr_text string "Create QR code image for standalone map in fullscreen mode" inc/showmap.php
mmp_text_geojson To change the text of GeoJSON icon title on the map. $geojson_text string "Export as GeoJSON" inc/showmap.php
mmp_text_download_gpx To change the text of GPX icon title on the map. $download_gpx_text string "download GPX file" inc/showmap.php
mmp_text_show_marker_on_map To change the text of "show marker on map" in the markers list on the map. $show_marker_on_map_text string "show marker on map" inc/showmap.php
mmp_text_edit_layer To change the text of edit layer link on the map. $edit_layer_text string "edit layer" inc/showmap.php
mmp_text_show_marker_on_map To change the text of "show marker on map" in the markers list on the map. $show_marker_on_map_text string "show marker on map" inc/showmap.php
mmp_text_edit_marker To change the text of edit marker link on the map. $edit_marker_text string "edit marker" inc/showmap.php
mmp_text_show_embedded_fullscreen To change the text of embedded_fullscreen icon on the map. $show_embedded_fullscreen_text string "Show embedded map in full-screen mode" inc/showmap.php
mmp_text_loading_map To change the text loading map on the map. $loading_map_text string "loading map - please wait..." inc/showmap.php
mmp_text_gpx_track_name To change the text of gpx track name on the map. $gpx_track_name_text string "Track name" inc/showmap.php
mmp_text_gpx_start_track To change the text of gpx start on the map. $gpx_start_track_text string "Start" inc/showmap.php
mmp_text_gpx_end_track To change the text of gpx end on the map. $gpx_end_track_text string "End" inc/showmap.php
mmp_text_gpx_distance To change the text of gpx distance on the map. $gpx_distance_text string "Distance" inc/showmap.php
mmp_text_gpx_moving_time To change the text of gpx moving time on the map. $gpx_moving_time_text string "Moving time" inc/showmap.php
mmp_text_gpx_duration To change the text of gpx duration time on the map. $gpx_duration_text string "Duration" inc/showmap.php
mmp_text_gpx_pace To change the text of gpx pace on the map. $gpx_pace_text string "Pace" inc/showmap.php
mmp_text_gpx_heart_rate To change the text of gpx heart rate on the map. $gpx_heart_rate_text string "Heart rate" inc/showmap.php
mmp_text_gpx_elevation To change the text of gpx elevation on the map. $gpx_elevation_text string "Elevation" inc/showmap.php
mmp_text_gpx_full_elevation_data To change the text of gpx full elevation data on the map. $gpx_full_elevation_data_text string "Full elevation data" inc/showmap.php
mmp_text_calculated_map_center To change the text of calculated from map center on the map. $calculated_map_center_text string "calculated from map center" inc/showmap.php
mmp_text_edit To change the text of `edit` on the map. $edit_text string "edit" inc/showmap.php
mmp_text_map To change the text of `map` on the map. $map_text string "map" inc/showmap.php
mmp_text_legend To change the text of `Legend` on the map. $legend_text string "Legend" inc/showmap.php
mmp_text_showme_where_i To change the text of `Show me where I am` on the map. $showme_where_i_text string "Show me where I am" inc/showmap.php


Map Settings Filters

Dynamically change the settings of MapsMarker Pro maps.

Chosen Filter Example

  • mmp_setting_map_dragging

    To change the ability to drag the markers on the map.

Usage


<?php
add_filter('mmp_setting_map_dragging', 'change_dragging_setting');
function change_dragging_setting($dragging_setting){
    return true;
}


Parameters

  • $dragging_setting boolean

    Defaults to true.


Source Code

This filter is located in inc/showmap.php

Complete list of map settings filters

Filter Functionality Parameter/s Default value Source Code
mmp_setting_map_dragging Whether the map be draggable with mouse/touch or not. $dragging_setting boolean true inc/showmap.php
mmp_setting_map_touchzoom Whether the map can be zoomed by touch-dragging with two fingers. $touchzoom_setting boolean true inc/showmap.php
mmp_setting_map_scrollwheelzoom Whether the map can be zoomed by using the mouse wheel. $scrollwheelzoom_setting boolean true inc/showmap.php
mmp_setting_map_doubleclickzoom Whether the map can be zoomed in by double clicking on it. $doubleclickzoom_setting boolean true inc/showmap.php
mmp_setting_map_boxzoom Whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing shift. $boxzoom_setting boolean true inc/showmap.php
mmp_setting_map_trackresize Whether the map automatically handles browser window resize to update itself. $trackresize_setting boolean true inc/showmap.php
mmp_setting_map_worldcopyjump With this option enabled, the map tracks when you pan to another "copy" of the world and moves all overlays like markers and vector layers there. $worldcopyjump_setting boolean false inc/showmap.php
mmp_setting_map_closepopuponclick Set it to false if you do not want popups to close when user clicks the map. $closepopuponclick_setting boolean true inc/showmap.php
mmp_setting_map_keyboard Makes the map focusable and allows users to navigate the map with keyboard arrows and +/- keys. $keyboard_setting boolean true inc/showmap.php
mmp_setting_map_keyboardpanoffset Amount of pixels to pan when pressing an arrow key. $keyboardpanoffset_setting integer 80 inc/showmap.php
mmp_setting_map_keyboardzoomoffset Number of zoom levels to change when pressing + or - key. $keyboardzoomoffset_setting integer 1 inc/showmap.php
mmp_setting_map_inertia If enabled, panning of the map will have an inertia effect where the map builds momentum while dragging and continues moving in the same direction for some time. Feels especially nice on touch devices. $inertia_setting boolean true inc/showmap.php
mmp_setting_map_inertia_deceleration The rate with which the inertial movement slows down, in pixels/second. $inertia_deceleration_setting integer 3000 inc/showmap.php
mmp_setting_map_inertiamaxspeed Max speed of the inertial movement, in pixels/second. $inertiamaxspeed_setting integer 1500 inc/showmap.php
mmp_setting_map_zoomcontrol Whether the zoom control is added to the map by default. $zoomcontrol_setting boolean true inc/showmap.php
mmp_setting_map_crs Changing the Coordinate Reference System value $crs_setting string "L.CRS.EPSG3857" inc/showmap.php
mmp_setting_map_fullscreencontrol Whether to add a button for displaying maps in fullscreen via HTML5. $fullscreencontrol_setting boolean true inc/showmap.php
mmp_setting_map_maxzoom If the native maximum zoom level of a basemap is lower, tiles will be upscaled automatically. $maxzoom_setting integer 21 inc/showmap.php
mmp_setting_map_tab Enables mobile hacks for supporting instant taps (fixing 200ms click delay on iOS/Android) and touch holds (fired as contextmenu events). $tab_setting boolean true inc/showmap.php
mmp_setting_map_taptolerance The max number of pixels a user can shift his finger during touch for it to be considered a valid tap. $taptolerance_setting integer 15 inc/showmap.php
mmp_setting_map_bounceatzoomlimits Set it to false if you do not want the map to zoom beyond min/max zoom and then bounce back when pinch-zooming. $bounceatzoomlimits_setting boolean true inc/showmap.php


Map Content Filter (mmp_map_content)

You can use this filter to add content before or after the map.

Filter Example

Usage


<?php
add_filter('mmp_map_content', 'additional_map_content', 10, 2);
function additional_map_content($map_content, $attributes){
    $before_map = "<h2>Hotspots of The City</h2>";
    $after_map  = "<span>Note: Some note for the site visitors</span>";
    return $before_map . $map_content . $after_map;
}


Parameters

  • $map_content string

    Defaults to The HTML content of the map..

  • $attributes array

    Defaults to The array of the map's shortcode. It contains the map ID and other information..


Source Code

This filter is located in inc/leaflet-core.php