Examples
These recipes combine the iframe configuration from the parameters page with the runtime postMessage API. Each is self-contained: drop it onto a page, replace the publishable key and ids, and adapt the markup to your framework.
Switch the displayed itinerary
A common pattern is a list of itineraries beside the map, where clicking one swaps the map's content without reloading the iframe. Post a mountaya:setItinerary command to the iframe's contentWindow on each selection. Wait for the mountaya:ready event before enabling the controls, so the first command is never posted too early.
You can carry display overrides on the same command, for example switching the terrain or the visible overlays as the content changes. See the events page for the full override list.
React to the ready event's bounds
The mountaya:ready event reports the map's viewport bounds as [west, south, east, north]. Use them to drive your own layout: render a caption with the extent, fit a static minimap, or note the active content id. This recipe reads the bounds and the active itinerary from the ready event and shows them beside the map.