My favorites | Sign in
Logo
                
Search
for
Updated Aug 24, 2009 by dylankkuhn
Labels: Phase-Deploy
TagReference  
The list of tags, their format, and parameters.

Geo Mashup Tag Formats

If you have tags from previous versions of Geo Mashup (like <!--GeoMashup--> or GEO_MASHUP_MAP), you'll have to change them to the new format. Since early versions of Geo Mashup only supported these tags in pages, and was generally used on only one page, this shouldn't be too difficult.

Now tags in post and page content use standard WordPress Shortcode format. Template tags have also been updated to use standard template tag parameter format in WordPress templates. These formats are not complicated - the following examples should be all you need to understand them.

Shortcode Parameters

Here's an example of a tag you might put into a post or page:

[geo_mashup_map height="200" width="400" zoom="2" add_overview_control="false" add_map_type_control="false"]

The tag is geo_mashup_map, after which any number of parameters are specified. Any parameters that are not specified will use a default value from the Geo Mashup Options. If the post or page has a location saved, single default settings are used, otherwise the global defaults are used.

Template Tag Parameters

To get a similar map in a template, use template tag syntax:

<?php echo GeoMashup::map('height=200&width=400&zoom=2&add_overview_control=false&add_map_type_control=false');?>

Note the 'echo' before GeoMashup. This is PHP for "display it right here", and as such is commonly used with template tags.

Tags

Category Legend

Inserts a table of colored map pins and the categories they go with. Checkboxes will show or hide category markers on the map. See the map tag for ways to customize.

Shortcode Tag: [geo_mashup_category_legend]

Template Tag: <?php echo GeoMashup::category_legend() ?>

Accepted Parameters:

Category Name

Inserts the name of the currently displayed map category, if any.

Shortcode Tag: [geo_mashup_category_name]

Template Tag: <?php echo GeoMashup::category_name(); ?>

Full Post

Displays full post content on a global map page if the 'Enable Full Post Display' option is checked.

Shortcode Tag: [geo_mashup_full_post]

Template Tag: <?php echo GeoMashup::full_post(); ?>

List Located Posts

Inserts a list of all posts with location information.

Shortcode Tag: [geo_mashup_list_located_posts]

Template Tag: <?php echo GeoMashup::list_located_posts(); ?>

List Located Posts By Area

Generates a list of located posts broken down by country and administrative area (state/province). Country heading is only included if there is more than one country. Names should be in the blog language if available.

Shortcode Tag: [geo_mashup_list_located_posts_by_area]

Template Tag: <?php echo GeoMashup::list_located_posts_by_area() ?>

Parameters:

Map

Inserts a map.

When the tag is in a located post or page, Single Maps settings are used by default. In a post or page without a location, Global Maps settings are used. In all other locations, Contextual Maps settings are used. You can change the default map content with the map_content parameter, such as [geo_mashup_map map_content="global"].

Shortcode Tag: [geo_mashup_map]

Template Tag: <?php echo GeoMashup::map() ?>

Accepted Parameters:

Post Coordinates

This is currently only available as a template tag which you can use to display the coordinates stored for a page or post. Have a look at Issue 134 for good examples of usage.

Template Tag: <?php $coordinates_array = GeoMashup::post_coordinates() ?>

Accepted Parameters:

  • places - number of decimal places to include in coordinates. Default is 10.

Returns:

  • An array containing 'lat' and 'lng' entries, so in the example $coordinates_array['lat'] would contain latitude.

Save Location

This can be used to set the location for a post when the post editor location search interface is not available.

When a post or page is saved, the location is read from a special shortcode in the content. The location is saved, and the special shortcode is removed.

For now at least, decimals must be a period, not a comma.

Shortcode Tag: [geo_mashup_save_location]

Parameters:

Show on Map Link

Inserts a link for the current post or page to overall blog map.

Shortcode Tag: [geo_mashup_show_on_map_link]

Template Tag: <?php echo GeoMashup::show_on_map_link() ?>

Accepted Parameters:

Tabbed Category Index

Generates output that lists located posts by category in markup that can be styled as tabs. Subcategories are included in their parent category tab under their own heading. Click on post titles opens the corresponding marker's info window on the map. The map can show all markers, or just those for the active tab.

Additional CSS is required in the theme stylesheet to get the tab appearance, otherwise the markup will just look like a series of lists. An example is included in tab-style-sample.css.

Shortcode Tag: [geo_mashup_tabbed_category_index]

Template Tag: <?php echo GeoMashup::tabbed_category_index() ?>

Parameters:

Visible Posts List

Generates a list of post titles that are currently visible on the map. Clicking the title opens the info window for that post.

Shortcode Tag: [geo_mashup_visible_posts_list]

Template Tag: <?php echo GeoMashup::visible_posts_list() ?>

Parameters:

Help, Comments

Comments and questions are welcome in our Google Group. Bugs and feature requests go in the issue tracker. Search both - your answer may be there!


Comment by bonhote, Oct 14, 2008

Thanks a lot for your work! It's easy to use (once you get used to it). I would like to add the map to all single.php pages, but hide it where no coordinates are given. How to achieve that? TIA

Comment by bonhote, Oct 14, 2008

Just found it:

<?php if(GeoMashup::post_coordinates(10)) { echo GeoMashup::map(); }  ?>
Hosted by Google Code