How to add geo meta data
with OSM wordpress plugin
Preperation
How to
Sample to add link to OSM with geo data in my template
- – - – - – - – - – - – - – - – - – - Preperation - – - – - – - – - – - – - – - – - – -
1.) Follow the OSM plugin installation instructions to prepare your blog for adding geo meta data.
- – - How to – - -
If you want to add geo data to your posts you simply have to use the standard WP custom fields with any field name:

You just have to be sure to set this name in the <settings> are of OSM plugin:

To check whether your geo data are valid enter your site address at the validator. There are some calls to get these info from your template files:
// echos a links to OpenStreetMap with post/page geo data. OSM_echoOpenStreetMapUrl()
// returns a links to OpenStreetMap with post/page geo data. OSM_getOpenStreetMapUrl()
// returns the Long value of post/page geo data OSM_getCoordinateLong()
// returns the Lat value of post/page geo data
OSM_getCoordinateLat()
- - - Sample to add link to OSM with geo data in my template - - -
Add these lines in the emplate file to create a link with geo data of your post.
<?php $NameOfPlace = get_the_title();?>
<?php if (function_exists(OSM_echoOpenStreetMapUrl)) { ?>
<?php if ((OSM_getCoordinateLong('osm'))&&(OSM_getCoordinateLat('osm'))) { ?>
<?php _e(" - Map:"); ?>
<?php echo "<a title='".$NameOfPlace."' target='_blank' href='".OSM_getOpenStreetMapUrl()."'> OSM</a >";?>
<?php }?>
<?php }?>
- – - – - – - – - – - – - – - – - – - BACK to plugin page - – - – - – - – - – - – - – - – - – -
