-
Notifications
You must be signed in to change notification settings - Fork 15
Feature Usage
These are some of the common things you can do with Geo Mashup.
- Add Widgets
- Cluster Markers
- Add Taxonomies
- Add a Global Map Page
- Use Auto Zoom
- Category Lines
- Use KML for richer maps
- Add a "show on map" link
- Customize the info window and other content
- More
Shortcodes will work in a text widget, so you can use [geo_mashup_map] and Other Tags within a 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.
- Under Settings / Geo Mashup / Overall check the "Enable Geo Search" setting and update options.
- Create a page where search results will be displayed.
- Under Appearance / Widgets place the Geo Mashup Search widget where you would like it to appear.
- Fill in the widget settings, making sure to select the results page you created in step 2, and save.
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 clusterer options using the markerClustererOptions action.
There is an Overall setting that allows you to choose which taxonomies are included on maps. The default is post category only.
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.
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.
At the bottom of Settings / Geo Mashup / Global Maps is a table of your categories. To enable connecting lines between posts of a category, select a color and enter a maximum zoom level for the category. Use a zoom level of 20 to always draw the line, or leave blank to never draw it.
Posts are connected in Geo Date order. By default the geo date is set to the post creation date, but you can change it in the post editor under Location / Geo Date.
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.
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".
You can create a map using Google My Maps and save it as KML using these instructions.
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 [geo_mashup_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.
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:
- Copy
map-frame.php
togeo-mashup-map-frame.php
- Copy
comment.php
togeo-mashup-comment.php
- Copy
full-post.php
togeo-mashup-full-post.php
- Copy
info-window-max.php
togeo-mashup-info-window-max.php
- Copy
user.php
togeo-mashup-user.php
- Copy
nearby-list.php
togeo-mashup-nearby-list.php
- Copy
search-form.php
togeo-mashup-search-form.php
- Copy
search-results.php
togeo-mashup-search-results.php
These files can also be copied unchanged (no extra geo-mashup-
prefix) to a geo-mashup-custom folder
which will protect them from being overwritten by upgrades.
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 or geo mashup custom folder to get started.
WordPress Background: Templates and Template Tags
- Most settings on the Geo Mashup settings page have a short description of the feature they enable. Those aren't repeated here, so look through them to be aware of top-level features.
- Look through the list of tags in the Tag Reference to see the growing variety of Geo Mashup capabilities.
- Code snippets tagged wordpress-geo-mashup in Snipplr
- The Google Group has many more snippets and wisdom compiled over the ages.
- You can see a fairly comprehensive list of completed enhancements, with lots of related information.
Most map customization is done via the javascript API, while the PHP API applies mostly to map data.