This shortcode will display a static map (like image) of the current post viewed by the visitor. It’ll automatically detect the current post and display its position on the map. This was introduced in version 3 as a replacement of the v2 shortcode [codespacing_static_map]
.
The settings of this map can be set from the menus (Progress Map / Default map settings), (Progress Map / Default map style settings) & (Progress Map / Default infobox settings)!
The shortcode [cspm_static_map]
supports the following parameters:
post_ids
center_at
zoom
show_overlay
width
height
show_secondary
map_style
initial_map_style
infobox_type
infobox_link_target
hide_empty
window_resize
One or more post ID to display on the map. If no post ID is available, the map will use the ID of the current post/page where you use this shortcode.
Example 1: [cspm_static_map]
Example 2: [cspm_static_map post_ids="1"]
Example 3: [cspm_static_map post_ids="1,2,3,4,5"]
The center point of the map. Enter the Latitude & Longitude of the center point or enter the ID of the post on which the map will be centered.
If multiple post ids were passed to the attribute post_ids
and center_at
is not defined, the plugin will center the map on the position of the first post in the attribute post_ids
.
Example 1: [cspm_static_map center_at="51.510879,-0.117813"]
Example 2: [cspm_static_map post_ids="1,2,3,4,5" center_at="1"]
Define the zoom of the map (from 0
to 19
).
Example: [cspm_static_map zoom="13"]
Show/Hide the marker overlays (infoboxes). Possible values are yes
(show), no
(hide).
Example: [cspm_static_map show_overlay="no"]
The width of the map in pixels or in %.
Example 1: [cspm_static_map width="100%"]
Example 2: [cspm_static_map width="500px"]
The height of the map in pixels or in %
Example 1: [cspm_static_map height="100%"]
Example 2: [cspm_static_map height="500px"]
Show/Hide the secondary markers added to a post. Possible values ar, yes
or no
. Defaults to yes
.
Example: [cspm_static_map show_secondary="yes"]
The skin of the map. To get the style name, follow these steps:
- Click on the menu “Progress Map”. Wait for the page to load!
- Click on the menu “Default Map style settings”
- Click the link “Demo” next to the style you like. A new page/window will open, the URL of that page/window holds the style name as the last attribute. So if the URL looks like
http://snazzymaps.com/style/42/apple-maps-esque
, the style name will beapple-maps-esque
.
Example: [cspm_static_map map_style="apple-maps-esque"]
The initial style of the map. Possible values are ROADMAP
, SATELLITE
, TERRAIN
, HYBRID
, custom_style
.
Example: [cspm_static_map initial_map_style="TERRAIN"]
Override the default infobox type. Possible values are, square_bubble
, rounded_bubble
, cspm_type1
, cspm_type2
, cspm_type3
and cspm_type4
.
Example: [cspm_static_map infobox_type="cspm_type1"]
Detect browser window resize and recenter the map. Possible values are yes
and no
.
Example: [cspm_static_map window_resize="no"]
Whether to hide the map when the post to display on it doesn’t have coordinates or to show an empty map. Possible values are yes
or no
. Defaults to yes
.
Example: [cspm_static_map hide_empty="no"]
Specify where to open the infobox link. Possible values are same_window
, new_window
or disable
.
Example: [cspm_static_map infobox_link_target="disable"]