...
Users of the embeded maps will then be presented with the following “share screen” in the app:
...
This means that the users will be getting a link to https:your-domain.com/
followed by a special mazemap url parameter mazemap_share_url
. You (the customer) needs to read this url parameter on your web page and update the embedded map accordingly to give the users the content they want.
Basically, taking the entire value of the parameter, and set the iframe src
value to it.
Example JavaScript code snippet:
Code Block | ||
---|---|---|
| ||
// Example code on customer web page
// When opening link such as:
// https://your-domain.com/maps/?mazemap_share_url=https%3A%2F%2Fuse.mazemap.com%2F%23v%3D1%26config%3Dcustomer-example-config%26center%3D10.407538%2C63.432910%26zoom%3D19%26zlevel%3D6%26utm_medium%3Dcustom_share_url
// Read the url
const url = new URL(location.href)
// Get the mazemap share url
const mazemapUrl = url.searchParams.get('mazemap_share_url')
// Update the iframe with the correct shared url:
document.getElementById("mazemap-app-iframe").src = mazemapUrl; |