$(".select_picture").change(function(){
var value;
x=document.getElementById("choice").value; // get the value of the select option stores it in x
switch(x)
{
case '0': //assign a case and the value, for my statement
value=0;
// alert(value);
break;
case '1':
value=1;
// alert(value);
break;
case '2':
value=2;
// alert(value);
break;
default:
value=null;
// alert(value);
break;
}
if(value!=null) //if the value select is not null it would execute
{
//alert(value)
$.getJSON('data'+value+'.js',function(items){ //gets the json coordinates from the file, data is the name plus the value and the type of file
$.each(items,function(i,val){
root=$(".root") //created a handler on the div where the map is in the html file
image=$("<img id='img'>").attr('src',imgs[value]).css({left:val[0],top:val[1]}) //
root.append(image);
})
})
}
});