<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">hi, i just finished up a project and out of it came what i hope may be a useful lightweight javascript library for others. i called it MapSpork, cause it's so simple it doesn't deserve a serious name<DIV><BR class="khtml-block-placeholder"><DIV>it came from an idea here:</DIV><DIV><FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 12px;"><A href="http://maps.dnr.state.mn.us/eco/rsg/minnesota/test.html">http://maps.dnr.state.mn.us/eco/rsg/minnesota/test.html</A></SPAN></FONT></DIV><DIV>posted by (i think) David Bitner?  MapSpork is an attempt to do that generically, with html classNames and id's to indicate what the map or button or any html element should do when clicked/selected/changed. the library then uses javascript regexp's and such to manipulate the url to zoom/query/pan as appropriate.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>anyway, my crappy testpage and some explanatory text is here:<FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 12px;"><A href="http://128.32.253.220/mapspork/example.html">http://128.32.253.220/mapspork/example.html</A></SPAN></FONT></DIV><DIV><FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 12px;"><FONT class="Apple-style-span" size="4"><SPAN class="Apple-style-span" style="font-size: 14px;">and a prettier page gutted from the project here:  <FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 12px;"><A href="http://128.32.253.220/naturetest/">http://128.32.253.220/naturetest/</A></SPAN></FONT></SPAN></FONT></SPAN></FONT></DIV><DIV><FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 12px;"><FONT class="Apple-style-span" size="4"><SPAN class="Apple-style-span" style="font-size: 14px;">and the javascript as mapspork.js in either of those directories.  works on Firefox, opera, safari and IE 6. </SPAN></FONT></SPAN></FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>there are 3 classes:</DIV><DIV>MapSpork. an HTML element with class=MapSpork and id='zoomin' when selected will indicate that the map should zoomin when clicked (just like the CGI). likewise for zoomout, and query. these are best as radio elements.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>NameSpork. an element with class=NameSpork and name='layers'  when changed (onchange) or selected (onselect) will cause the map to be redrawn with whatever values come from layers (just like the CGI). but since the page is not redrawn, the state is maintained auto. NameSpork can be use on anything sent into the url.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>ClickSpork. ... class=ClickSpork and id='panne'  will call the function MapSpork.panne when clicked. these are best on buttons. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>there is not too much functionality as is, because this is about the extent of my mapserver CGI knowledge, but it's easliy extended by creating a function MapSpork.whatever = function(){ alert('whatever') } and</DIV><DIV>then creating an html element with id='whatever' and the appropriate Spork class:</DIV><DIV>&lt;input type='button' id='whatever' class='ClickSpork'&gt;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>-brent</DIV></DIV></BODY></HTML>