Below is a way to reduce you SVG size...at least with ASV. With the
thousands of lines of code where add an onmousemove event, this would be
significant.
document.getElementById('Minor rivers').addEventListener("onmousemove",
toolTip, false);
<g id="Minor rivers" type="Rivers" tagType="layer"
style="fill:none;stroke:rgb(0,5,254);stroke-width:50">
<!-- Replace this -->
<path onmousemove="toolTip(evt,'Rivers','---Info---','Rec_ID : 168
','Myriver_id : 3 ')" id="th8rec167" d="M..."/>
<!-- With something like this -->
<path Rec_ID='168' Riv_id='3' id="th8rec167" d="M..."/>
</g>
//In you js, add event listeners with this
function load(evt){
document.getElementById('Minor
rivers').addEventListener("onmousemove", toolTip, false);
}
//Access attributes with
function toolTip(evt){
var object=evt.target;
var type=object.parentNode.getAttributeNS(null,'type');
var Rec_ID=object.getAttributeNS(null,'Rec_ID');
var Riv_id=object.getAttributeNS(null,'Riv_id');
alert(type);
}
Something like the js below can add them to all the necessary g tags.
var gTag = svgDoc.getElementsByTagName("g");
number=gTag .length;
i=0;
while (i<number){
object=gTag .item(i);
if(object.getAttributeNS(null,"tagType")=='layer'){
object.addEventListener("onmousemove", toolTip, false);
}
i++;
}
Sean
marikhu wrote:
>Dear All,
>I would like you to just visit this site to check out the time taken
>to load the file
>
>http://www.cs.ait.ac.th/~t103824/XML/SVG/newSVG_Kathmandu/Index_MAIN.HT
>ML
>
>This is AJAX, using thematic layers mainly for user interactions with
>individual or a set of themes.
>
>Any comments would be welcome.
>
>[ I would very much like to thank Andre M. Winter for helping me out
>with motivation to get myself deeper into SVG and , and for informing
>me about loads of resources easily obtainable from carto.net. It seems
>to me now that its only a matter of time that constraints me from
>developing applications in SVG as everything is so well organized and
>tutored in carto.net ]
>
>Regards,
>Ramesh Marikhu
>AIT
>
>
>
>
>
>
>-----
>To unsubscribe send a message to: [EMAIL PROTECTED]
>-or-
>visit http://groups.yahoo.com/group/svg-developers and click "edit my
>membership"
>----
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my
membership"
----
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/