Text renders on globe just fine, but I want to make it a clickable link. If I try to put HTML into the name component it just displays the HTML instead of rendering it and making it a clickable link.
How do I make the Geographic Text become a clickable link?
var temps = [
{
'name': '<a href="http://www.example.com">Tokyo JP</a>',
'elevation': 10000,
'latitude': 35.685,
'longitude': 139.751389
}
];
var text,
textAttributes = new WorldWind.TextAttributes(null),
textLayer = new WorldWind.RenderableLayer("World Temperatures");
// Set up the common text attributes.
textAttributes.color = WorldWind.Color.CYAN;
// Set the depth test property such that the terrain does not obscure the text.
textAttributes.depthTest = false;
// For each peak, create a text shape.
for (var i = 0, len = temps.length; i < len; i++) {
var temp = temps[i],
tempPosition = new WorldWind.Position(temp.latitude, temp.longitude, temp.elevation);
text = new WorldWind.GeographicText(tempPosition, temp.name);
// Set the text attributes for this shape.
text.attributes = textAttributes;
// Add the text to the layer.
textLayer.addRenderable(text);
}
// Add the text layer to the WorldWindow's layer list.
wwd.addLayer(textLayer);
EDIT: I added the piece of code where the data is inserted into the object. I didn't add the code earlier because anyone with WorldWind experience should know exactly what I was talking about and maybe have greater insight into my specific issue. Though js is not my strongest language, maybe someone would be so kind as to point out the obvious to me, if it is truly an easy fix ;)
Basically this:
'name': '<a href="http://www.example.com">Tokyo JP</a>',
is the HTML I want rendered.