Linking the MapSearch 2.0 plugin to the RouteViewer 3.0 plugin and/or the PoiViewer 2.0 plugin

By default, the MapSearch plugin links back to the RouteYou website. However, when you use both the MapSearch and RouteViewer / PoiViewer plugins on your website, you will want to change this behaviour.

Step 1: MapSearch

In the MapSearch plugin, you need to change the URL to which routes and/or places of interest will link.

Your configuration object will now, for example, look like this:

RTY.MapSearch.load({
        'token': '<your RouteYou web service token>',
        'language': '<your language>',
        ...
        'route.view.link': 'http://www.mywebsite.com/routeview?route-id=%id%',
        'poi.view.link': 'http://www.mywebsite.com/poiview?poi-id=%id%'
    });

Step 2: RouteViewer / PoiViewer

For the RouteViewer and PoiViewer plugin, you need to extract the route / place of interest id from the URL.

If you use this convenience method, your configuration object will now, for example, look like this:

RTY.RouteViewer.load({
        'token': '<your RouteYou web service token>',
        'language': '<your language>',
        ...
        'params.route.id': parseInt(RTY.Util.Uri.getQueryParameter('route-id'), 10)
    });
RTY.PoiViewer.load({
        'token': '<your RouteYou web service token>',
        'language': '<your language>',
        ...
        'params.poi.id': parseInt(RTY.Util.Uri.getQueryParameter('poi-id'), 10)
    });

© 2006-2021 RouteYou - www.routeyou.com