Reply To: Maps Modification wanted, where to start?

Home Forums MapPress Support Maps Modification wanted, where to start? Reply To: Maps Modification wanted, where to start?

#13556
Chris
Keymaster

    Hi,

    If I understand: you want to redirect to other sites, not to other posts in the blog, is that correct?

    If so – that’s really not supported by the plugin. But you may be able to do it with an action ‘mappress_map_display’.

    You would need to display the map as a mashup in order to redirect clicks to a URL.

    You would also need to use an action to modify the target URL for the pois before they’re displayed. Action ‘mappress_map_display’ receives a single ‘map’ object just before the map is displayed. I haven’t tested it, but the code might look like this:

    
    function myaction($map) {
      if ($map->name == 'mymapname') {
        $map->pois[0]->url = 'url1';
        $map->pois[1]->url = 'url2';
      }
    }
    add_action('mappress_map_display', 'myaction');

    To display the map (if the post ID is #1234):
    [mashup query="p=1234" mashupclick='post' name='mymapname']