momozza

Inserting a checkbox to toggle MapImage display

Discussion created by momozza on May 30, 2013
Latest reply on May 30, 2013 by vinaybansal
Hello,

I have been trying to insert a checkbox that, when checked, displays my MapImage on the basemap. I am using an if/else function to toggle the image display at the .MapImageLayer level. The two methods used are .addImage(MapImage) and .removeImage(MapImage). This does not seem to work and I am trying to understand why (I am new to javascript).

Here is my code:
if(getElementById("chbx").checked=true)
{ 
init.map.mil.addImage(Tile);
}
else
{
init.map.mil.removeImage(Tile);
}


Any help would be greatly appreciated!

Outcomes