Skip to content
Dylan Kuhn edited this page Apr 5, 2015 · 12 revisions

These are some of the common things you can do with Geo Mashup.

Add Widgets

Shortcodes will work in a text widget, so you can use [geo_mashup_map] and Other Tags within a widget.

Geo Mashup Search Widget

Geo Mashup can provide a geo search widget to find posts within a specified distance of a search location. A "find me" button allows a search near the user's current location.

  1. Under Settings / Geo Mashup / Overall check the "Enable Geo Search" setting and update options.
  2. Create a page where search results will be displayed.
  3. Under Appearance / Widgets place the Geo Mashup Search widget where you would like it to appear.
  4. Fill in the widget settings, making sure to select the results page you created in step 2, and save.

Clustering

Marker clustering is currently supported with Google maps only.

For global maps with many markers, it can be more meaningful to see how many markers are in an area than masses of overlapping markers. Clustering does this for you. Because the problem is more severe at lower zoom levels, it's enabled by zoom level in the "Cluster Markers Until Zoom Level" setting for global maps.

Clusters are represented by a partially transparent red circle icon. The minimum cluster size is 4 markers, and clicking a cluster will zoom to that area in the map. Custom javascript code can modify these MarkerClustererPlus options using the 'markerClustererOptions' action.

Taxonomies

There is an Overall setting that allows you to choose which taxonomies are included on maps. The default is post category only.

Global Mashup Page

You can have a single page with a global map that will be the target of links generated by Geo Mashup.

Create a page, include the [geo_mashup_map] shortcode in it, and select the page in the Settings / Geo Mashup / Overall / Global Mashup Page dropdown list. The "Show on Map Link" tag and "Add Category Links" options will now create links to this page, which will load a global map appropriate for the link.

Auto Zoom

Zoom levels can be set to 'auto', in both settings and tags. The zoom level is calculated to show all the content on the map. A consequence of this is that the content must first be added to the map before the final zoom level is set, and this operation may be visible when the map loads.

Save a location by uploading a KML Attachment

Instead of searching for a location in the location editor, you can upload a KML file attachment with a post or page using the "Add Media" button above the editor. Once uploaded, you can insert a link in your post or just close the upload window. The geographic center of all features in the KML file will be used to determine a default location for the post or page. Review this location in the location editor, adjust if needed, and save it.

Note: Google maps can only load KML files that are accessible to its servers, so a KML attachment on a private domain (e.g. localhost) or site will not work with Google.

Displaying a KML file

Once a page or post has a KML file attached, that file will be loaded in a single map.

You can also display KML files associated with the selected marker on a global map by checking "Show Geo Attachments" in Settings / Geo Mashup / Global Maps, or setting the marker_select_attachments parameter of the map tag to "true".

Creating a KML file

You can create a map using Google My Maps and save it as KML using these instructions.

Add a "show on map" link to posts with a location

You can add a link from any located item to your designated global map page, with the global map centered on the clicked item. Use the [show_on_map_link] shortcode tag for a single item, or the template tag <?php echo GeoMashup::show_on_map_link(); ?> to add links to all posts or pages. See the Tag Reference for details.

Customize the info window and other content (templating)

The content in the info window is generated by a template that works just like any other WordPress template. Geo Mashup comes with a default template found in default-templates/info-window.php that generates content similar to prior versions. Don't edit this, but you can copy it to geo-mashup-info-window.php in your theme directory, and your custom template will be preserved in future upgrades. There are templates for other types of info window content that can also be customized by copying to your theme folder:

  • Copy map-frame.php to geo-mashup-map-frame.php
  • Copy comment.php to geo-mashup-comment.php
  • Copy full-post.php to geo-mashup-full-post.php
  • Copy info-window-max.php to geo-mashup-info-window-max.php
  • Copy user.php to geo-mashup-user.php
  • Copy nearby-list.php to geo-mashup-nearby-list.php
  • Copy search-form.php to geo-mashup-search-form.php
  • Copy search-results.php to geo-mashup-search-results.php

You can also change the styling of the info window and other map components, copy css/map-style-default.css to map-style.css in your theme folder to get started.

WordPress Background: Templates and Template Tags

More Feature Resources

APIs For More Customization

Most map customization is done via the javascript API, while the PHP API applies mostly to map data.

Clone this wiki locally