PDA

View Full Version : Paths from Datasets


donavonguyot
08-08-2004, 02:19 AM
Investigating Laszlo as a potential replacement for a solution that is currently prototyped with ASP Turbine for dynamic compilation of image assets from a web service and Flash Remoting for client communications back to the server. 2 Questions: 1. Is there any straight forward way to draw lines using a loop through a dataset of X&Y points in your product??? 2. The X&Y points were deduced from GPS data and there is a lot of it. Turbine chokes when compiling it. What is the correlation between dataset size and compile time???

Here is the Actionscript Loop for comparison:

drawMapPath=function(){
_root.createEmptyMovieClip("MapPath_mc", 80);
MapPath_mc.lineStyle(1, 0xFF0000, 100);
MapPath_mc.moveTo(asArray[ArrayFirst]["varX"], asArray[ArrayFirst]["varY"]);
for (var i = 1; i <= ArrayLast; i++) {
MapPath_mc.lineTo(asArray[i]["varX"], asArray[i]["varY"]);
};
}

Great product... Hope you can help me figure these things out so that I can move forward with the evaluation.

Donavon

d~l
08-08-2004, 06:44 AM
I'm quite new to Laszlo myself .. but your application is close to what I'm interested in ..

Perhaps you could parse the external data set into an SVG object .. SVG spec here ..

http://www.w3.org/Graphics/SVG/

and info on path drawing here ..

http://www.w3.org/TR/SVG/paths.html

and then embed the SVG object into Laszlo using embed function.

...

The downside to this approach is that all users must have Adobe SVG viewers installed .. or you must offer a viewer download link ..

http://www.adobe.com/svg/

...

Experiment by creating your path in an SVG file and view in IE Explorer (with the SVG viewer plugin installed).

If that works, then embed your map.svg in Laszlo presentation layer.

Something like this ..

[code starts here .........]

<EMBED SRC="map.svgz" WIDTH="400" HEIGHT="400" name="svgMap" ALIGN="center" TYPE="image/svg-xml" pluginspage="http://www.adobe.com/svg/viewer/install/">


<NOEMBED>

An SVG Viewer such as the Adobe SVG Viewer plug-in is
required to see this map.

Go here to download and install:-

http://www.adobe.com/svg/viewer/install

</NOEMBED>

[code ends here .........]


...


I think that there may be an SVG example somewhere in Laszlo documents.

...

Can't answer your other question on Laszlo performance. How many paths must be plotted?

donavonguyot
08-09-2004, 08:46 AM
Thanks for the suggestions, but in this case SVG is not a viable alternative (kind of defeats the purpose if you have to download an SVG viewer when you are already working within a vector animation environment;-). Anyway... Have since done some testing with very large datasets and the initial results are quite good. I guess that to rephrase my original question... Has anyone written a "Line" class or will I have to roll my own??? Seems like it should be one of the base classes, but near as I can tell it doesn't exist (Which is funny, since the view for a box appears to support outlined paths...) Thanks again and best of luck with the product!

antun
08-09-2004, 09:19 AM
Is there any straight forward way to draw lines using a loop through a dataset of X&Y points in your product???

Yes, you can data-bind a view to the coordinates so it will be replicated based on the data. Your view can basically be a line. The World Clock application uses a dataset to display the various cities given their coordinates, and label position:

http://www.laszlosystems.com/lps/lz-utils/welcome_support/coverpages/welcome_cover.lzo?lzt=html

The X&Y points were deduced from GPS data and there is a lot of it. Turbine chokes when compiling it. What is the correlation between dataset size and compile time???

Compile time is not the issue. Laszlo works differently from Turbine/Generator/etc.: The application gets compiled once, and is downloaded and run from the client. So it is the client that makes the request for the data and creates the lines based on that data. It's possible that the client will take a while to start up if you really have a lot of lines to display. How many lines will there be?

-Antun

d~l
08-09-2004, 10:07 AM
.. defeats the purpose if you have to download an SVG viewer when you are already working within a vector animation environment;-). you'll see more of the Adobe SVG viewer plugin .. already bundled in the latest Adobe Reader .. and in Opera browser.

See here examples of carto mapping ..

http://www.carto.net/papers/svg/links/ .. but you'll need to download the Adobe SVG viewer to navigate this site;-

dl