• Resolved Jan-Philipp

    (@pogstar)


    Hi Dylan, hi WordPress Comunity.

    I have a map set up which show different vendors. The vendors are based on the user role “vendor”. So essentially the map shows the location of different users.

    I would like to set up a list of visible posts (in my case users). The visible post list tag is doing it but I want to customize the output.

    I found this threat which is dealing with the issue: https://github.com/cyberhobo/wordpress-geo-mashup/issues/175

    Here Dylan gives following example:

    <a href="#sidebar_map"
    onclick="window.frames['sidebar_map'].GeoMashup.clickMarker('<?php the_ID();
    ?>');">Show on map</a>

    I somehow cannot get it to work. My code looks like this. Am I missing something.

    (....)
    
    <div id="map-container" style="height:100%">
    
    <?php $map_args = 'name=mymap&zoom=12&add_overview_control=false&auto_info_open=false&add_map_type_control=false&object_name=user&object_ids=' . $user_ids .'&locality_name=' . $city;
    echo GeoMashup::map( $map_args );?>
    
    </div>
    
    <?php $shops = 
    
    get_users (array(	'role'         => 'vendor',
    	'meta_key'     => 'city',
    	'meta_value'   => $city));
    
    $prefix = '';
    foreach ($shops as $user) {
    
    $store_id= $user->ID;?>
    
    (....)
    
    <a href="#mymap" onclick="frames['mymap'].GeoMashup.clickMarker('<?php $store_id;?>')">View on Map</a>
    
    <?php } ?>

    Any help would be appriciated.

    Kind regards,
    Jan-Philipp

    https://wordpress.org/plugins/geo-mashup/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘user query with 'Show on map link'’ is closed to new replies.