Route from a fixed origin
Show driving directions and travel time from a chosen origin (usually the property) to whichever POI the visitor clicks.
What it does
When a visitor clicks a POI, the map draws the route from the configured origin to that POI and shows the travel time in the info window. Without this option, clicking a POI shows only its name and category.
It also enables the travel-time columns on the Summary plugin (distance + duration to the nearest places of each category).
Enable on the JavaScript Map plugin
Add a routeFrom object to your yatmoConfig:
yatmoConfig = {
licenseKey: '...',
language: 'EN',
container: 'map',
center: [4.3442926, 50.8510525],
zoom: 16,
routeFrom: {
latitude: 50.8510525,
longitude: 4.3442926
}
};
Enable on the iframe map
With the current iframe, plugin.html, add routeFrom=1 (or left / right to choose the panel's side, or popup for the travel times only, see below). Routes are then measured from the property itself, the latitude / longitude of the map:
<iframe width="100%" height="500" style="border:0"
src="https://map.yatmo.com/plugin.html?licenseKey=YOUR_FRONTEND_KEY&country=BE&language=en&latitude=50.846714&longitude=4.352514&zoom=16&routeFrom=1"></iframe>
The older iframe.html is still served and accepts routeFromLatitude and
routeFromLongitude for an origin different from the property. plugin.html
does not take a separate origin: if you need one, use the JavaScript plugin's
routeFrom object above, which does.
Travel times only, without the address field
By default the option also adds a small panel where the visitor can type any address to get a route from the property. To keep only the travel times shown when a POI is clicked, without that panel:
- on the iframe, use
routeFrom=popup; - on the JavaScript plugin, add
hideRouteFrom: truenext to therouteFromobject.
<iframe width="100%" height="500" style="border:0"
src="https://map.yatmo.com/plugin.html?licenseKey=YOUR_FRONTEND_KEY&country=BE&language=en&latitude=50.846714&longitude=4.352514&zoom=16&routeFrom=popup"></iframe>
Notes
The origin doesn’t have to be the property itself — you can route from a transport hub, a city centre, or any fixed point. Useful for “how far from the airport?” kinds of pages.
For routes between arbitrary points (not anchored to a fixed origin), call the Route API directly.