Skip to content Skip to main navigation Skip to footer

Shortcodes

The Waymark Shortcode allows you to embed Maps in your content.

Once created, Maps and Collections can be embedded within your content by simply adding the Shortcode.


Using the Shortcode

The Shortcode is simply a text placeholder that tells Waymark what to display.

It can be added to any content in WordPress that supports shortcodes.

For example, this Shortcode will display the Map with an ID of 1649:

Waymark map_id="1649"

This Shortcode will display the same Map, but with a different Basemap and zoom level:

Waymark map_id="1649" basemap="Satellite" map_zoom="11" 

This Shortcode will display all Maps in the Collection with an ID of 27:

Waymark collection_id="27"

To display a Basemap without any data, simply provide centre coordinates and zoom level, like this:

Waymark map_centre="54.526814,-3.017289" map_zoom="16" basemap="Satellite"

Shortcode Parameters

The Shortcode can be passed the following parameters.

ParameterValueDescription
map_idMap IDDisplay a single Map. You can create Maps (and obtain Map IDs) in WP Admin > Waymark > Maps.
collection_idCollection IDDisplay all Maps in a Collection. You can create Collections (and obtain Collection IDs) in WP Admin > Waymark > Collections.
map_centreLatitude,LongitudeThe initial centre coordinates of the Map. By default Waymark centres the Map so all Data is visible.
map_zoom0-18The initial zoom of the Map. By default Waymark zooms the Map so all Data is visible.
basemapBasemap NameWhich Basemap to display when the Map first loads (instead of the default). The value must match a Basemap Name listed in WP Admin > Waymark > Settings > Basemaps.
map_heightNumber of pixelsSpecify the desired height of the Map. The default can be changed in WP Admin > Waymark > Settings > Misc.
shortcode_header0 or 1Whether to display the Shortcode Header (if Meta exists for the Map). The default can be changed in WP Admin > Waymark > Settings > Misc.
show_gallery0 or 1Whether to display an image gallery for Markers that have images associated with them. The default can be changed in WP Admin > Waymark > Settings > Misc.
show_filter0 or 1Whether to display the Overlay Filter. This enables visitors to filter for which Markers, Lines and Shapes are currently visible on the Map. The default can be changed in WP Admin > Waymark > Settings > Misc.
show_elevation0 or 1Display an interactive elevation profile graph below the Map for Lines that have elevation data. The default can be changed in WP Admin > Waymark > Settings > Misc.

Shortcode Markers

Markers can be displayed using the Shortcode, without the need for a Map to be created.

To display a Marker, pass your preferences to the Shortcode like this:

Waymark marker_centre="54.526814,-3.017289" marker_type="shelter" marker_title="Emergency Shelter" marker_description="Built in 1590 as a shelter for shepherds and their trusty dogs." marker_image="https://www.waymark.dev/wp-content/uploads/2019/11/UNADJUSTEDNONRAW_thumb_6458-1024x768.jpg"
ParameterValueDescription
marker_centreLatitude,LongitudeThe centre coordinates of the Marker to be displayed.
marker_typeType NameThe type of Marker to display, must match a valid Type Key (e.g. “photo”)
marker_titleTextThe Title to display when the Marker is clicked.
marker_descriptionTextThe Description to display when the Marker is clicked.
marker_imageImage URLAn Image URL to display when the Marker is clicked.

Shortcode Files

Files (GPX, KML & GeoJSON) can be displayed using the Shortcode, without the need for a Map to be created.

To display a File, pass the URL to the Shortcode like this:

Waymark file_url="https://www.waymark.dev/wp-content/uploads/2022/05/route-map-1647.gpx"

By default, all Overlays (Markers/Lines/Shapes) will be displayed using the default Type (i.e. the first listed in Settings).

You can specify a different Type to use like this:

Waymark file_url="https://www.waymark.dev/wp-content/uploads/2022/05/route-map-1647.gpx" file_line_type="red" file_marker_type="alert"
Related Articles
0 Comments

There are no comments yet

Leave a comment

Submitting as Guest, your email address will not be published.
Login | Register.