• Skip to primary navigation
  • Skip to main content
  • 07982 975459
  • simon@skirridsystems.co.uk

Skirrid Systems

Web Design & IT Support

  • Services
    • Church Websites
    • Custom Websites & Facebook
    • Email and Groups
    • Building Tours
    • Data Protection and GDPR
    • Technical Support
    • WordPress Plugins
    • Getting Started
  • Latest Projects
  • OS DataHub Maps
  • Contact
  • About
  • Embedded
    • Getting Started
    • Primer
    • Open Source
You are here: Home / OS DataHub Maps / Filter Hooks

Filter Hooks

There is currently one filter hook in the maps plugin.

os_map_post

This filter is applied after the map has been generated and allows you to add your own content below the map. Typical use is to allow a custom sorted listed of markers to appear below the map, perhaps using data in the JSON file which is not used to generate the map itself.

The filter function can take up to 6 arguments:

my_filter( $html, $mapid, $args, $marker_list, $gpx_list, $kml_list )

html is the HTML code generated from the map. You need to return this with whatever additions you need.

mapid is an integer identifying the map on the page. The first map has mapid=1

args is the array of shortcode arguments after the plugin has parsed them

marker_list is the array of markers. Each array item will itself be an array consisting of at least [‘location’], [‘layer’], [‘color’] and [‘desc’]. If you have used a JSON file then there may be additional keys too.

gpx_list is the array of gpx files in the same format as the marker array. Here location refers to the URL of the file.

kml_list is the array of KML files, formatted in the same way as GPX files.

« Custom CSS Up Miscellaneous »

© 2022 Skirrid Systems · Cookies