renato_stancato wrote: > I need to retrieve the coordinate of a path element in a certain distance. > I know that there is a method called getPointAtLength but it's not > implemented.
In which viewer? I tried the following code (crude, but does the job) with ASV3 on IE 5.5 and Mozilla 1.7 and it works. <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> <svg xml:space="preserve" width="100%" height="100%"> <script><![CDATA[ function GetPathData() { var path = document.getElementById("Pa"); var tl = path.getTotalLength(); var p1, p2, p3, p4; p1 = path.getPointAtLength(0); p2 = path.getPointAtLength(tl/3); p3 = path.getPointAtLength(2*tl/3); p4 = path.getPointAtLength(tl); alert(tl + '\n' + p1.x + ', ' + p1.y + '\n' + p2.x + ', ' + p2.y + '\n' + p3.x + ', ' + p3.y + '\n' + p4.x + ', ' + p4.y); } ]]></script> <path id="Pa" fill="none" stroke="green" stroke-width="2" d="M 50,50 L 150,80 C 200,20 200,20 300,50 S 100,200 200,200 S 150,100 100,100 H 50"/> <circle cx="200" cy="100" r="20" fill="darkgreen" onclick="GetPathData()"/> </svg> -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- ----- 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/