ok so I’m working on it ??
the solution is somewhere in here
/**
* A template tag to insert a link to a post on the mashup.
*
* @see show_on_map_link()
*/
public static function post_link($option_args = '') {
return self::show_on_map_link($option_args);
}
/**
* A template tag to return an URL for the current location on the
* global map page.
*
* @since 1.3
* @todo What would happen if the global map is not a post map?
*
* @param string|array $args Template tag arguments.
* @return string The URL, empty if no current location is found.
*/
public static function show_on_map_link_url( $args = null ) {
global $geo_mashup_options;
$defaults = array( 'zoom' => '' );
$args = wp_parse_args( $args, $defaults );
$args = array_filter( $args );
$url = '';
$location = self::current_location_guess();
if ( $location ) {
$url = get_page_link($geo_mashup_options->get('overall', 'mashup_page'));
if ( !$url )
return '';
$args['center_lat'] = $location->lat;
$args['center_lng'] = $location->lng;
if ( $geo_mashup_options->get( 'global_map', 'auto_info_open' ) == 'true' )
$args['open_object_id'] = $location->object_id;
$url = htmlentities( add_query_arg( $args, $url ) );
}
return $url;
}
/**
* A template tag to insert a link to the current location post on the
* global map page.
*
* @since 1.3
*
* @param string|array $args Tag arguments.
* @return string The link HTML, empty if no current location is found.
*/
public static function show_on_map_link( $args = null ) {
$defaults = array( 'text' => __( 'Show on map', 'GeoMashup' ),
'display' => false,
'zoom' => '',
'show_icon' => true );
$options = wp_parse_args($args, $defaults);
$link = '';
$url = self::show_on_map_link_url( $args );
if ( $url ) {
$icon = '';
if ($options['show_icon'] && strcmp( $options['show_icon'], 'false' ) != 0) {
$icon = '<img src="'.GEO_MASHUP_URL_PATH.
'/images/geotag_16.png" alt="'.__('Geotag Icon','GeoMashup').'"/>';
}
$link = '<a class="gm-link" href="'.$url.'">'.
$icon.' '.$options['text'].'</a>';
if ($options['display']) {
echo $link;
}
}
return $link;
}
/**
* Visible posts list template tag.
*
* Returns a placeholder where a related map should display a list
* of the currently visible posts.
*
* @since 1.2
* @link https://code.google.com/p/wordpress-geo-mashup/wiki/TagReference#Visible_Posts_List
*
* @param string|array $args Template tag arguments.
* @return string Placeholder HTML.
*/
public static function visible_posts_list($args = null) {
$args = wp_parse_args($args);
$list_html = '';
$for_map = 'gm-map-1';
if ( !empty( $args['for_map'] ) ) {
$for_map = $args['for_map'];
}
if ( !empty( $args['heading_text'] ) ) {
$heading_div = '<div id="' . $for_map . '-visible-list-header" style="display:none;">';
$heading_tags = '<h2>';
if ( !empty( $args['heading_tags'] ) ) {
$heading_tags = $args['heading_tags'];
}
$list_html .= balanceTags( $heading_div . $heading_tags . $args['heading_text'], true );
}
$list_html .= '<div id="' . $for_map . '-visible-list"></div>';
return $list_html;
}
/**
* List located posts template tag.
*
* Returns an HTML list of all located posts.
*
* @since 1.1
* @link https://code.google.com/p/wordpress-geo-mashup/wiki/TagReference#List_Located_Posts
*
* @param string|array $option_args Template tag arguments.
* @return string List HTML.
*/
public static function list_located_posts( $option_args = null ) {
$option_args = wp_parse_args( $option_args );
$option_args['object_name'] = 'post';
$list_html = '<ul class="gm-index-posts">';
$locs = GeoMashupDB::get_object_locations( $option_args );
if ($locs) {
foreach ($locs as $loc) {
$list_html .= '<li><a href="'.get_permalink($loc->object_id).'">'.
$loc->label."</a></li>\n";
}
}
$list_html .= '</ul>';
return $list_html;
}