Hi all, This is my first post on the list. I am new to mapstraction. I am trying to hide all the markers using the code I found on the very good book of Adam DuVander. But I am still not able to do that (I am not the smartest guy in scripting). I have this code: function hideAllMarkers() { var allm = mapstraction.markers; for (var i=0; i<allm.lenght; i++) { var thism = allm[i]; thism.hide(); } }; Then I call the function in a link: <a href="javascript:hideAllMarkers();">hide all</a> Nothing. What I am doing wrong? You can visit the test page here: http://vignati.ch/map/mapstraction2.html Many thanks for your help Mauro -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20101123/c0212cbe/attachment.htm>
sometimes the best debugger is a second pair of eyes it looks like a typo. try allm.length not allm.lenght good luck and welcome to mxn 2010/11/23 Mauro Vignati <vignus at gmail.com>> Hi all, > This is my first post on the list. I am new to mapstraction. > > I am trying to hide all the markers using the code I found on the very good > book of Adam DuVander. But I am still not able to do that (I am not the > smartest guy in scripting). > > I have this code: > > function hideAllMarkers() { > var allm = mapstraction.markers; > for (var i=0; i<allm.lenght; i++) { > var thism = allm[i]; > thism.hide(); > } > }; > > Then I call the function in a link: <a > href="javascript:hideAllMarkers();">hide all</a> > > Nothing. What I am doing wrong? You can visit the test page here: > http://vignati.ch/map/mapstraction2.html > > Many thanks for your help > Mauro > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20101123/426ff5a9/attachment.htm>
Hi Mauro, Try this one ;) map.removeAllMarkers(); removeAllMarkers removes all the Markers on a map ++ b_b Le 23/11/2010 19:21, Mauro Vignati a ?crit :> Hi all, > This is my first post on the list. I am new to mapstraction. > > I am trying to hide all the markers using the code I found on the very good > book of Adam DuVander. But I am still not able to do that (I am not the > smartest guy in scripting). > > I have this code: > > function hideAllMarkers() { > var allm = mapstraction.markers; > for (var i=0; i<allm.lenght; i++) { > var thism = allm[i]; > thism.hide(); > } > }; > > Then I call the function in a link:<a > href="javascript:hideAllMarkers();">hide all</a> > > Nothing. What I am doing wrong? You can visit the test page here: > http://vignati.ch/map/mapstraction2.html > > Many thanks for your help > Mauro > > > > > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com