javascript - Removing ImageOverlay in map -
i have big problems replacing image in if sentence. remove image first. cant place new image when within if-sentence.
var image= 'garage.png'; var imageurl = image, imagebounds = l.latlngbounds([ [63.431004174, 10.397958755], [63.430433118, 10.399938226]]) var map = l.mapbox.map('map', 'examples.map-i86nkdio').fitbounds(imagebounds); var overlay = l.imageoverlay(imageurl, imagebounds).addto(map); map.removelayer(overlay); // if appears later in code // function changeimages(newvalue){ var slider = newvalue; if(slider < 5){ var image = 'garagealtered.png'; var imageurl = image,imagebounds = l.latlngbounds([ [63.431004174, 10.397958755], [63.430433118, 10.399938226]]) var map = l.mapbox.map('map', 'examples.map-i86nkdio') .fitbounds(imagebounds); var overlay = l.imageoverlay(imageurl, imagebounds).addto(map); } }
javascript map
No comments:
Post a Comment