[OSM-dev] Experiment: AJAX and <canvas> based online editor
Nick Whitelegg
nick at hogweed.org
Fri Aug 18 14:24:30 BST 2006
As part of my investigations into online editor options I am experimenting
with an AJAX and <canvas> tag based solution to see if it gives improved
performance (compared to the applet).
I'm not so sure right now. If you go to
http://www.free-map.org.uk/osmajax/
you can see a demo. Wait until the data has been downloaded then try moving
using the buttons. Drawing the nodes, segments and ways becomes progressively
slower as more data gets loaded in - it thus seems the rate determining step
is less the rendering but more looping through the nodes, segments and ways.
This is on a fast machine (Linux, Firefox 1.5, 1gb ram, 3GHz)
However - given a screen covers 5km x 5km, it may be suitable for editing
tasks such as creating new ways and editing the tags of the existing ways. On
the other hand, maybe it's worth just updating the applet, in view of the
less-than-great performance. An AJAX-based solution would have advantages
such as easy integration with the rest of the web page (HTML-based tag
editing facilities could easily be used for example).
On the other hand, does anyone have any general tips on improving drawing
performance? This also applies to osmeditor2 which is also rather slow when
drawing data - even though it does not attempt to draw things outside the
current viewing area. The algorithm at present is more or less:
loop through nodes
if node is in current viewing area, draw it
end
loop through ways
loop through segments in way
if node1 or node2 in view
draw segment
end if
end
end
Nick
More information about the dev
mailing list