Linking the MapSearch 2.0 plugin to the Routeviewer 3.0 plugin

By default, the MapSearch plugin links back to the RouteYou website. However, when you use both the MapSearch and RouteViewer 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 locations 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?routeId=%id%'
    });

Step 2: RouteViewer

For the RouteViewer plugin, you need to extract the route 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.Url.getQueryParameter('routeId'), 10)
    });

© 2006-2019 RouteYou - www.routeyou.com