I have an init() function which creates an image overlay for a map when the html body is loaded. within the function a mapOverlay variable is created. It\'s basically the functi
You need to declare the variable outside of the scope of your function to be able to use it in other functions.
So:
<script>
var mapOverlay;
function init()
{
//stuff
mapOverlay = new OpenSpace.Layer.MapOverlay("logo");
//more stuff
}
function ChangeImage()
{
//stuff
mapOverlay.setHTML('<img src="$Choice" style="width: 100%; height: 100%; opacity: 0.8;"/>');
}
</script>