Advertisement

PoiViewer 2.0 plugin

Introduction

You can show your place of interest on your own site using the PoiViewer 2.0 plugin. There are three versions of this plugin.

Free PoiViewer plugin

Via the RouteYou website

  1. On www.routeyou.com, surf to the place of interest you want to show on your website.
  2. Click  (Share).
  3. Click Embed.
  4. Copy the code.
  5. Paste the code into the HTML of your own website, adjust the width and height if necessary.

Getting started

This version is iframe-based. To add it to your site, add the following code where you want the plugin to appear:

<iframe src="//plugin.routeyou.com/poiviewer/free/?language=en" width="800" height="500" frameborder="0" allowfullscreen></iframe>

You can change the iframe's width and height to suit your website.

Configuring the plugin

The parameters should be passed in the URL of the iframe. Numbers, strings and booleans can be passed in a simple key=value pattern. Complex values can be passed as JSON encoded strings (remember that these will then need to be URL-encoded as well).

You can find the list of parameters in the "Parameters" section. For the free version, not all parameters are available. The available parameters are marked with .

Example

The example below will show you Ghent's city hall. Both the interface and the place of interest's data will be in English.

<iframe src="//plugin.routeyou.com/poiviewer/free/?language=en&amp;params.poi.id=2507179" width="800" height="500" frameborder="0" allowfullscreen></iframe>

Basic version (iframe)

Getting started

This version is iframe-based and works the same way as the free version. To add it to your site, add the following code where you want the plugin to appear:

<iframe src="//plugin.routeyou.com/poiviewer/basic/?token=<your RouteYou web service token, see below>&amp;language=en" width="800" height="500" frameborder="0" allowfullscreen></iframe>

You can change the iframe's width and height to suit your website.

Configuring the plugin

The parameters should be passed in the URL of the iframe. Numbers, strings and booleans can be passed in a simple key=value pattern. Complex values can be passed as JSON encoded strings (remember that these will then need to be URL-encoded as well).

You can find the list of parameters in the "Parameters" section. Some parameters are not applicable to this version. The available parameters are marked with .

Upgrading from the free version

To upgrade from the free version, simply change the /free/ part in the URL to /basic/ and add your key or token (see below) to the list of parameters.

For example, if you currently have this:

<iframe src="//plugin.routeyou.com/poiviewer/free/?language=en&amp;params.poi.id=2507179" width="800" height="500" frameborder="0" allowfullscreen></iframe>

You will need to change it to this:

<iframe src="//plugin.routeyou.com/poiviewer/basic/?key=<your RouteYou web service key, see below>&amp;language=en&amp;params.poi.id=2507179" width="800" height="500" frameborder="0" allowfullscreen></iframe>

Example

The example below will show you Ghent's city hall. Both the interface and the place of interest's data will be in English.

<iframe src="//plugin.routeyou.com/poiviewer/basic/?token=<your RouteYou web service token, see below>&amp;language=en&amp;params.poi.id=2507179" width="800" height="500" frameborder="0" allowfullscreen></iframe>

Advanced version (JavaScript)

Getting started

To add the advanced version of the plugin to your site, two pieces of code need to be added. First, you need to provide HTML div elements where the PoiViewer components will be placed. You can set their id's to any name you prefer, but make sure they are unique. You can position these divs in any way that fits your site design. The example code below will put the title first, then the map and the detail component (which will contain a.o. the POI's description and media) on the right of the map. You can omit any component by not creating a div for it and not passing a div id in the configuration object.

<div id="routeYouPoiViewerTitle"></div>
<div id="routeYouPoiViewerDetail" style="margin-left: 10px; width: 300px; float: right;"></div>
<div id="routeYouPoiViewerMap"></div>

Second, add the JavaScript code that launches the plugin. To minimise the load time of your page, it is best to put this code as far down the page as possible.

<script type="text/javascript" src="//plugin.routeyou.com/poiviewer/2.0.js"></script>
<script type="text/javascript">
RTY.PoiViewer.load({
        'token': '<your RouteYou web service token, see below>',
        'language': '<your language, see below>',
        'title.div': 'routeYouPoiViewerTitle',
        'map.div': 'routeYouPoiViewerMap',
        'poiDetail.div': 'routeYouPoiViewerDetail'
    });
</script>

Tabs

You can also show a tabbed version of the PoiViewer plugin. Use the code below to show all components except the title in tabs.

<div id="routeYouPoiViewerTitle"></div>
<div id="routeYouPoiViewerTabButtons" style="margin-bottom: 10px;"></div>
<div id="routeYouPoiViewerTabPane"></div>
<script type="text/javascript" src="//plugin.routeyou.com/poiviewer/2.0.js"></script>
<script type="text/javascript">
RTY.PoiViewer.load({
        'token': '<your RouteYou web service token, see below>',
        'language': '<your language, see below>',
        'title.div': 'routeYouPoiViewerTitle',
        'tabButtons.div': 'routeYouPoiViewerTabButtons',
        'tabPane.div': 'routeYouPoiViewerTabPane',
        'tabPane.components': ['map', 'poiDetail']
    });
</script>

Configuring the plugin

To further configure the plugin, add parameters from the "Parameters" section below as needed to the JavaScript object. Some parameters are not applicable to this version. The available parameters are marked with .

Some important guidelines:

Styling the plugin

The plugin will automatically use the CSS of the surrounding page, which means fonts, colors and most other styling will match your website. Some tips and important guidelines:

Mobile-friendly

The plugin can be made responsive (different settings on small and large screens) by setting a responsive breakpoint with the layout.breakpoints parameter. Contact sales[at-r.] for more information.

Example

The example below will show you Ghent's city hall. Both the interface and the place of interest's data will be in English.

<script type="text/javascript" src="//plugin.routeyou.com/poiviewer/2.0.js"></script>
<script type="text/javascript">
RTY.PoiViewer.load({
        'token': '<your RouteYou web service token>',
        'language': 'en',
        'title.div': 'routeYouPoiViewerTitle',
        'map.div': 'routeYouPoiViewerMap',
        'poiDetail.div': 'routeYouPoiViewerDetail',
        'params.poi.id': 2507179
    });
</script>

Parameters

Some parameters are not available in all versions. Each parameter is marked with the version(s) in which it is available:

General

Content

You can decide what to show with the following parameters.

Layout and behaviour

The plugin adapts to the height of the user's browser window or the iframe. When resizing, the map takes the height of the title into account, while the detail component take the height of the tab buttons and title into account. The following parameters influence this behaviour.

Media

The following parameters change the behaviour of the place of interest media.

Title component

Map component

Detail component

Tabs

Compatibility

The PoiViewer 2.0 plugin is compatible with all major browsers. However, to ensure full compatibility, it is vital that the pages on which you place the plugin begin with a valid DOCTYPE, for example:

<!DOCTYPE html>
<html ...

Plans & pricing

For a list of the RouteYou functionalities per type of account, take a look at the RouteYou Functionality Overview per account type.

Back to RouteYou

© 2006-2024 RouteYou - www.routeyou.com