My web application incorporates Open Street Maps through an iframe. As a result, if the user clicks on the “Data by OpenStreetMaps” link, OpenStreetMaps.org opens within my application. I would rather the website open in a new window. Is there a way to modify the attribution link to open the OpenStreetMaps website in a new window?
I think you need to create a custom attribution link, like I do with the edit map link on http://www.yournavigation.org:
PermaLink = new OpenLayers.Control.Permalink('test', 'http://www.openstreetmap.org/edit'); PermaLink.element.textContent = 'Edit map'; map.addControl(PermaLink);
Thanks for the tip! However, wouldn’t this just add another link? I’m still stuck with the problem of users clicking the old link and having the OpenStreetMaps website come up inside my application window.
Is there a way to turn off the default attribution link once I’ve added a custom attribution link?
Yes, this adds another link, but the original attribution link is created only if you add
to the map definition. So just remove that line and add the new permalink and you’re done
Thank you so much! You’d think I would have noticed that line of my code when I first started working on this problem…