|
TagReference
The list of tags, their format, and parameters.
Geo Mashup Tag FormatsIf 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 ParametersHere'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 ParametersTo 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. TagsCategory LegendInserts 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 NameInserts the name of the currently displayed map category, if any. Shortcode Tag: [geo_mashup_category_name] Template Tag: <?php echo GeoMashup::category_name(); ?> Full PostDisplays 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 PostsInserts 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 AreaGenerates 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:
MapInserts 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 CoordinatesThis 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:
Returns:
Save LocationThis 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 LinkInserts 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 IndexGenerates 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 ListGenerates 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, CommentsComments and questions are welcome in our Google Group. Bugs and feature requests go in the issue tracker. Search both - your answer may be there! |
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
Just found it:
<?php if(GeoMashup::post_coordinates(10)) { echo GeoMashup::map(); } ?>