Visibility [Archive] - XML Elves

Visibility

Chris
08-23-2005, 01:57 AM
Hi there,
I?m working on a website about campus and audtorium information using embedded SVG in HTML.
There is a drop-down menu (using JS and a HTML div tag) where I can chose the audtorium I want to find.
What do I have to manipulate in the SVG document to make the questioned element from the drop-down menu visible whereas the other elements remain invisible?
I know that I need an "if-else-clause", but which var do I have to use?
Thanks

Anonymous
08-23-2005, 07:49 AM
Nice idea, but I suppose its not that easy...
this is an example for the embedded SVG file:
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http&#58;//www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"
&#91;
<!ATTLIST a
xlink&#58;href CDATA #IMPLIED>
<!ATTLIST g
mvns&#58;scaleEle CDATA #IMPLIED
mvns&#58;minscale CDATA #IMPLIED
mvns&#58;maxscale CDATA #IMPLIED
mvns&#58;styleprop CDATA #IMPLIED>
&#93;>
<svg id="map" onzoom="onZoomInit&#40;&#41;;" width="500" height="470" viewBox="0 0 0.7583467 0.7133426" preserveAspectRatio="xMinYMin" xmlns="http&#58;//www.w3.org/2000/svg" xmlns&#58;xlink="http&#58;//www.w3.org/1999/xlink" xmlns&#58;mvns="http&#58;//www.mapviewsvg.com">
<title>View1 - Map</title>
<defs>
<menu id="MapViewMenu">
<header>Custom Menu</header>
<item action="ZoomIn">Einzoomen</item>
<item action="ZoomOut">Auszoomen</item>
<item action="OriginalView">Originalansicht</item>
<separator />
<item action="Quality">Bessere Qualit?t</item>
<separator />
<item action="Find">Suchen...</item>
<item action="FindAgain">Weitersuchen</item>
<separator />
<item action="Help">Hilfe</item>
</menu>
</defs>
<style type="text/css"><!&#91;CDATA&#91;
.th0leg0MAP &#123; fill&#58;rgb&#40;23,0,220&#41;;stroke-width&#58;0.0001517;stroke&#58;rgb&#40;0,0,0&#41; &#125;
.th0leg1MAP &#123; fill&#58;rgb&#40;0,255,0&#41;;stroke-width&#58;0.0001517;stroke&#58;rgb&#40;0,0,0&#41; &#125;
.th0leg2MAP &#123; fill&#58;rgb&#40;255,0,255&#41;;stroke-width&#58;0.0001517;stroke&#58;rgb&#40;0,0,0&#41; &#125;
.th0leg3MAP &#123; fill&#58;rgb&#40;20,164,172&#41;;stroke-width&#58;0.0001517;stroke&#58;rgb&#40;0,0,0&#41; &#125;
.th0leg4MAP &#123; fill&#58;rgb&#40;255,255,0&#41;;stroke-width&#58;0.0001517;stroke&#58;rgb&#40;0,0,0&#41; &#125;
.th0leg5MAP &#123; fill&#58;rgb&#40;0,0,0&#41;;stroke-width&#58;0.0001517;stroke&#58;rgb&#40;0,0,0&#41; &#125;
.th0leg6MAP &#123; fill&#58;none &#125;
.LTxt &#123; font-family&#58;Arial,Helvetica,sans-serif;baseline-shift&#58;10%;pointer-events&#58;none &#125;
.LPTxt &#123; font-family&#58;Arial,Helvetica,sans-serif;baseline-shift&#58;20%;pointer-events&#58;none &#125;
&#93;&#93;></style>
<script type="text/javascript">
<!&#91;CDATA&#91;
var menuRoot = parseXML&#40;printNode&#40;document.getElementById&#40;"MapViewMenu"&#41;&#41;, contextMenu&#41;;
contextMenu.replaceChild&#40;menuRoot.firstChild,conte xtMenu.firstChild&#41;;
var mapAktScale = document.documentElement.currentScale;
function onZoomInit&#40;&#41; &#123;
onSVGZoom&#40;mapAktScale&#41;;
mapAktScale = document.documentElement.currentScale;
&#125;
&#93;&#93;>
</script>
<rect x="-12800%" y="-12800%" width="25600%" height="25600%" style="fill&#58;white" />
<g id="mapContent" mvns&#58;minscale="1" mvns&#58;maxscale="1000000000000">
<desc>Abc.shp</desc>
<g id="th0" display="inline" mvns&#58;scaleEle="" mvns&#58;minscale="1" mvns&#58;maxscale="1000000000000" mvns&#58;styleprop="fill">
<path id="th0rec0" class="th0leg0MAP" style="fill&#58;rgb&#40;23,0,220&#41;" d="M0.3896437 0.5099020v-0.3850085h0.3594548v0.3850085 z" />
<path id="th0rec1" class="th0leg1MAP" style="fill&#58;rgb&#40;0,255,0&#41;" d="M0.3007145 0.6514628v-0.3850085h0.3594548v0.3850085 z" />
<path id="th0rec2" class="th0leg2MAP" style="fill&#58;rgb&#40;255,0,255&#41;" d="M0.0466310 0.7040944v-0.3850085h0.3594548v0.3850085 z" />
<path id="th0rec3" class="th0leg3MAP" style="fill&#58;rgb&#40;20,164,172&#41;" d="M0.0092481 0.4572890v-0.3850085h0.3594549v0.3850085 z" />
<path id="th0rec4" class="th0leg4MAP" style="fill&#58;rgb&#40;255,255,0&#41;" d="M0.2835241 0.3942566v-0.3850085h0.3594549v0.3850085 z" />
<path id="th0rec5" class="th0leg5MAP" style="fill&#58;rgb&#40;0,0,0&#41;" d="M0.0773912 0.5492822v-0.3850085h0.3594549v0.3850085 z" />
</g>
</g>
<text id="ASVText" x="0.0106169" y="0.0303339" class="LTxt" display="none" style="fill&#58;rgb&#40;0,0,0&#41;;font-size&#58;0.0212337">For correct functionality this site needs the Adobe SVG Viewer 3.0.</text>
</svg>


and this file is controlled by some external JS, XML and CSS files.
the code of the drop-down menu and its JS
<script language="JavaScript" type="text/javascript" charset="iso-8859-1">
<!--
function prezoomObj&#40;&#41; &#123;
if &#40;document.formzoomObj.listobj.selectedIndex > 0&#41; selRec&#40;'field0=' + document.formzoomObj.listobj.options&#91;document.form zoomObj.listobj.selectedIndex&#93;.text,'th0',true,fal se,false,20&#41;;
else &#123;
clearColorArray&#40;&#41;;
fullExtent&#40;&#41;;
&#125;
&#125;
//-->
</script>
-----------------------------------------
<div id="zoomObject">
<form name="formzoomObj">
<select name="listobj" onChange="prezoomObj&#40;&#41;;" size="1" class="ZoomObjEle">
<option selected>zoom...</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
</select>
</form>
</div>
If you want to see the whole site at it, give me your email-adress and i?ll send you the zipped folder(42kb).
That one?s become pretty long!

Chris
08-23-2005, 07:56 AM
Sorry.Last one is from me. Ididn?t see that i wasn?t logged in.

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum