tetetetetet

[geotag /]
The Geo Tag plugin allows your posts and pages to contain location information which includes latitude, longitude, region, and country. This plugin has an easy and simple interface that can detect your current location or you can choose your location by searching for an address or clicking on the Google map. The location information is saved to the post or page and is included in the RSS feed and meta tags. The location information is available for use in your theme with the get_post_meta method. The plugin can also display a Google Map of the current post or a list of posts through the shortcode [geotag /]. The shortcode also exposes posts as geoJson.

  1. Open a new or existing post/page and add the location information
  2. [Optional] In the Google API Console click on ‘Services’ and turn on ‘Google Maps API v3′. Then click on ‘API Access’ and update your Google Latitude History plugin settings with your Simple API key. The api key tracks usuage and is not necessary. If your website uses a SSL certificate then set Google Maps to use SSL.

 

 

其他事項

Usage

  • The data can be used in your theme by accessing it with the following methods:
  • $region = get_post_meta($post_id, “geotag_region", true);
  • $country = get_post_meta($post_id, “geotag_country", true);
  • $location = get_post_meta($post_id, “geotag_location", true);
  • location is $region.",".$country
  • $latitude = get_post_meta($post_id, “geotag_latitude", true);
  • $longitude = get_post_meta($post_id, “geotag_longitude", true);

Shortcode Options

  • [geotag /]
  • The shortcode without any options will inject a geoJson representation of your geo tagged posts
  • If currentpostmap or postsmap option is true, a map representing the geo tagged posts will be created
  • height = height of the map in pixels
  • width = width of the map in pixels
  • order = order of the posts by ascending or descending (ASC, DESC)
  • limit = number of post (default 10)
  • currentpostmap = show map of current post (true or false)
  • postsmap = show map of multiple posts (true or false)
  • markercolor = color of the map markers ( HTML color codes like #0000FF )
  • maptype = Google map type ( HYBRID, ROADMAP, SATELLITE, TERRAIN )
  • zoom = map zoom level