[cfgeo_map]
[cfgeo_map]The Content (accepts HTML)[/cfgeo_map]
Use this shortcode to display a Google Map based on either the visitor’s location or a custom static location. With Geo Controller, there is no need for additional plugins to display basic location maps (single-point only).
This shortcode requires a valid Google Maps API key. Read the documentation to configure your key.
Parameters
- title – (text) – Tooltip shown on hover over the map marker
- address – (text) – Text displayed above the map marker
- pointer – (image URL) – Custom map marker icon (max size: 40x40px)
- latitude – (number) – Sets the map’s latitude (used for custom static location)
- longitude – (number) – Sets the map’s longitude (used for custom static location)
- zoom – (integer, 1–18) – Sets the zoom level
- width – (text) – Map width in px or %
- height – (text, optional) – Map height in px or %
- scrollwheel – (1 or 0) – Enables/disables scroll zoom
- navigationControl – (1 or 0) – Enables/disables navigation controls
- mapTypeControl – (1 or 0) – Enables/disables map type controls
- scaleControl – (1 or 0) – Enables/disables scale controls
- draggable – (1 or 0) – Enables/disables drag movement on the map
- infoMaxWidth – (text) – Max width of the info window (default max: 600px)
Return
Draws a Google Map based on the provided parameters and the visitor’s location (if no coordinates are given). Note: The behavior depends on your plugin settings, and the Google Maps API key must be configured.
Example:
Basic usage with visitor location:
Columbus, 43215, Ohio, (OH), United States
Advanced Example
Use a custom static location with detailed content inside the map popup:
My Company Name
No Name Street 35, New York, USA
We have what you need
[cfgeo_map longitude="-74.0059" latitude="40.7128" zoom="15" title="My Company Name" scrollwheel="0"] <h3>My Company Name</h3> <p>No Name Street 35, New York, USA</p> <p>We have what you need</p> [/cfgeo_map]
By wrapping content inside the shortcode, you create an info box (modal) that appears when a visitor clicks the map marker. Use latitude
and longitude
to define location, title
for hover text, and see all other parameters above for additional customization.