Hello,
I want to embed a route on my own website. But when doing so by the SHARE code provided here I only get the static image - when clicking on play then the image of the route vanishes and an empty area remains - the route playback will not start.
When trying the same with the preview button, everything works. When doing it as IFrame nothing works.
Do you know a trick on this?
Regards,
Lucas
Hi Lucas - try disabling any browser add-ons you have to see if this helps. It sounds like something you have installed is interfering with page requests and masking where the request is coming from.
Hi,
thanks for your reply. I have tried this. But it doesn't change anything.
Any other suggestions?
On another website I administrate I had to do some trick a few weeks ago concerning an iframe with an openstreetmap widget. It stopped working suddenly after some update (webserver update I think). And as I found out the problem was that the iframe source was not located on the same domain as the website itself was. I had to copy some script from the internet to make it working - the script gets the iframe source as url-parameter and is called as iframe source. This the code of this:
<?php
$url = isset($_GET['url']) ? $_GET['url'] : '';
if($url)
{
$url_parts = parse_url($url);
/* Get the full URL as base and set this script bevor, because we need to load embedded files over this script */
$base_url = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?url=' . $url_parts['scheme'] . '://' . $url_parts['host'];
/* Split the path in parts */
$path = preg_split('#/#', dirname($url_parts['path']));
/* Generate array to map relative URLs into absolute URLs */
$replace_last = $base_url;
$search[] = './';
foreach($path as $i => $a)
{
$search[] = $search_last = $search_last . '../';
$replace[] = $replace_last = $replace_last . $a . '/';
}
/* Remove the last */
array_pop($search);
/* And reverse it */
$search = array_reverse($search);
/* Get the header and send correct content type */
$header = get_headers($url, true);
header('Content-type: ' . $header['Content-Type']);
/* Get the content */
$content = file_get_contents($url);
/* Replace relative URLs with absolute URLs */
$content = str_replace($search, $replace, $content);
/* Output the content */
echo $content;
}
I've tried this for the plotaroute widget too. But it didn't work... But in fact I don't really understand what the script is doing exactly. Do you?
Regards,
Lucas
Hi again,
I've done some more invesigation now. And I found the problem: In the browser settings third party cookies have to be activated to make the widget working.
I've added a hint on this on my website for the visitors to know about it.
Thanks for your hints nevertheless!
Regards,
Lucas
Glad you sorted it out. Thanks for sharing this Lucas.
Hi again,
has something changed in these days? Now I have the problem that the menu buttons for showing the route description or disabling the km markers etc. do not work anymore for embedded routes. Otherwiese on plotaroute website they work. It seems to be a problem in webkit based browsers, not in mozilla browsers.
By the way: Allowing third party cookies is of course not something users like to do. Do we really need cookies for showing embedded maps?
Regards,
Lucas
I think the third party cookies was probably a red herring, as this isn't a requirement for our mebedded maps, but it's possible that by changing this setting you changed something else - for example, we do depend on the HTTP referer being sent (the identity of the website making the request), which can be removed by some security software. or browser add-ons.
Can you share a link to your embedded map and we'll have a look at the menu button issue?
No problem:
http://lucas.sichardt.net/index.php?Seite=eigene_Strecken
Thanks for investigating!
Reading your hints I have investigated a bit more too. I tried if disabling the option to send "do not track" hints to websites changes behaviour. But it seems that this doesn't change anything - even disabling third party cookies while also disabling "do not track" hints does not work...
This map works fine for us here Lucas.
Mhh, interesting.
something seems to be wrong with Vivaldi-Browser then. As I have tried every privacy setting now and it doesn't work I've posted the problem in Vivaldi forums.
But concerning the cookies I have to say that I can reproduce the problem in Firefox when blocking thrid-party cookies there. So I guess that something is special about cokies here as Vivaldi and Firefox don't share much code as far as i know...