[ka-Map-dev] Overlay Objects

Lorenzo Becchi lorenzo at ominiverdi.com
Wed Feb 8 06:10:40 EST 2006

Today I've started talking with Andrea about push a little bit on the 
Overlay System.
Next week we'll be together developing only on ka-map (maybe...)
Starting point is PG work:

His API seems to me a good starting point.
About Point, Symbol, Icon and Label implementation I've nothing to say 
(maybe we can change little things before starting coding).
What we have in mind is about Linestring and Polygon. We want to start 
from ka-map core function: tiling.
We hope to offer a solution that could work on any AJAX compliant 
browser avoiding, for the moment, vectorial implementations as IE 
Canvas or SVG or WZ_jsgraphics.

First of all we think to create a layer (we can call it Canvas, or a 
better name) in the Viewport where, starting from XML, objects can be 
designed by the server, then tiled and finally back to the client.
In contrary to wz_jsgraphics, this system permits managing Lines and 
Polygons of big size and let us use pan and zoom functions without 
charging the client (wz_graphics could really slow the client). For the 
client is like another layer over the others: it can be very light if 
well optimized (few kb for tile).
If there's an updating procedure we would like to try to implement a 
solution that update only changed tiles (es: a point that moves on the 

now the problem is to give this drawn objects some life.
We think to create a "special" level (trying to call it CanvasProxy, or 
a better name).
We are not sure about this implementation, maybe somebody can 
contribute with a better idea.
Anyway we want to use, inside the CanvasProxy, a transparent image (1px 
height & width) and force his dimensions to the map extent (so it 
changes depending on zoom level) then let it pan as layers below.
The hazard is: an imagemap.
Imagemap is the only HTML object that permits to design  irregular 
polygons (not just rectangles) and simply attach event listeners (es: 
onclick, onmouseover). Moreover it can be easily manage with DOM 
scripting (+ or -).
Now, for each polygon drawn in the Canvas there will be an AREA tag 
with his shape (rectangle, circ, circle, poly, polygon; maybe just 
polygons) for the CanvasProxy transparent image. Then for each polygon 
we can associate onclick and mouseover events extending ka-map ones.

In a future we can extend this method to edit objects just drugging 
polygon extremes, alter the XML on the fly and send it back to the 
server to render the Canvas layer.

To start working on this we need to choose the XML schema we want to 
use. Maybe Paul already decided (let us know).

please, send comments


More information about the ka-Map-dev mailing list