Hi
I am using a kml file to display polylines and markers with names and
descriptions.
If I include a link in the <description> and display in an info
window, it opens a new tab etc which I don't want. I thought the
solution would be to display the description in a div via innerHTML
but even when I do that, it still opens a window (yes I've tried
changing the target...)
Could anyone assist as I'm sure I've made a mistake. Otherwise it
seems odd that google should think that this needs to be a default
behaviour?
I've also tried to hijack the link by using js but google seems to
strip this out of the KML
Thanks.
TomH
Sample KML :
<description><![CDATA[
Test test test<br /><b>Date</b>: 19 March 2011<br /><a href='http://
example.com/show/1' target='_parent'>More Information</a>
]]>
</description>
Part of my js:
var kmlLayer = new google.maps.KmlLayer('
http://www.example.com',
{suppressInfoWindows: true});
kmlLayer.setMap(map);
google.maps.event.addListener(kmlLayer, 'click', function(kmlEvent) {
var name =
kmlEvent.featureData.name;
var descr = kmlEvent.featureData.description;
document.getElementById('Name').innerHTML = name;
document.getElementById('Description').innerHTML = descr;
});