Maps made easy

Map examples

All map examples were generated with our plugin. Most examples can be imported directly to your plugin. A download button can be found at the end of each example page.

Interactive Map to Set Form Elements

This example demostrates how an interactive map can be used to set the value of a select form field:

Example Form

If you use forms on your WordPress site, you will probably use a plugin to generate them. In most cases, the form plugin will provide you a shortcode that will somehow look like this: [form-xyz id="1"]. You can then use this shortcode to place the form somewhere on your pages or posts.

You can help the user to fill out the form by providing an interactive map. You can place this map either below or above your form. You will then end up with two shortcodes on your site:

[interactive_map id="1"]
[form-xyz id="1"]

We assume that our select field has the following HTML:

<select id="location">
	...
	<option value="newyork">New York</option>
	...
</select>

The next step is to tell our map what has to be done when the user interacts with the map. The plugin allows to execute JavaScript code when a marker is clicked. The code for setting a select field value is quite simple. All we need is the following line:

jQuery("#location").val(click_value);

There are two critical parts in this code that have to be changed on your site:

  1. In this example we used the selector #location which is basically the id of our select field. The selector depends on the form and the plugin that you use. You will have to look at the HTML of your form to identify the correct field.
  2. The plugin allows to store additional information for each marker in the click_value variable. In this example we use the click_value to store the option value of the corresponding select entry.

    Therefore, for New York we will store “newyork” in the click value. This will then set the select field to “New York” whenever the user clicks on New York.

If you have problems to find the right selector or option values contact us and send us the url of a page that contains the corresponding form. We will then send you the right selector for your form.

The map configuration can be found here:

Name Value Description
Region United States List with all available regions
Width auto Width of the map in pixel. 'Auto' means that the map is centered in the available width.
Height auto Height of the map in pixel. 'Auto' means that the map is centered in the available height.
Display mode Markers Specifies the display mode of the map.
Border resolution Provinces The resolution of the map borders.
Tooltips On Allows to display a tooltip for highlighted map elements.
Tooltips: Trigger focus The user interaction that causes the tooltip to be displayed.
Tooltips: Use HTML On Specifies if the tooltips should use HTML. This allows to customize the tooltips even more. For example, if this property is on, it is possible to display images wihtin the tooltip.
CSS
#{cssid} circle {
   cursor: pointer;
}
#{cssid} .tooltip-title {
  white-space: nowrap;
  text-align: center;
}
#{cssid} .google-visualization-tooltip {
  border-radius: 20px;
}
#{cssid} .google-visualization-tooltip-item {
  padding: 0 15px;
}
HTML
<div id="{cssid}">
  %%map%%
</div>

JavaScript

Executed when a marker/region is clicked.

Click value can be defined for each map element.

jQuery("#location").val(click_value);
Color Name Click Value
New York City newyork
Miami miami
Omaha omaha
Chicago chicago
Los Angeles losangeles

Comments

If you need help or have questions, please leave a comment.


Search

Responsive? Yes!

Our maps are fully responsive. They automatically fit into the available width. Try it by resizing your browser window.

Did you know…

  • All examples are importable to your plugin.
  • We extend our set of examples from time to time. If you think there is an example missing, write us a message and we will try to add it!

User reviews

  • Best map-plugin I could find.
  • Great support. Real fast response. This was exactly what I needed. Very flexible and useful.
  • Was waiting for plugin like this for ages! Customer support is also great.
  • Customer support is excellent and very quick. I have no hesitation in recommending this product.

Example for a sidebar map


All maps can also easily be added to your sidebar.