I appreciate your work, Bratliff but don't you understand that they
are doing dragging by CSS3 'transform'. That is a position movement
that you cannot read by DOM.
I tried 'click' with Polyline and I was disappointed. 'mousedown' and
'mouseup' return equal coordinates undependent of drag.
We need the Point() of actual position.
Polygon 'click' must be cured immediately. In a day or two there will
be a crowd of people who have a fullscreen polygon that is stealing
all the clicks.
Polygon 'click' is not documented but it is mentioned in of the
examples. The object that Polygon 'click' returns, does not include
pixel property at all, and I can imagine the reason.
I can see that you are using tile based SVG (with some overlap). You
never asked any opinions.
Polygon and Polyline have undocumented methods:
set_map();
get_map();
map_changed();
We're not using DP, it is too slow as you point out.
On Sep 25, 2009 12:46 AM, "bratliff" <brat...@umich.edu> wrote:On Sep 24, 2:11 am, Esa <esa.ilm...@gmail.com> wrote: > Click on map displays the results. Zooming ...
The Douglas-Peucker algorithym is too slow for "on-the-fly"
compression. It is a recursive algorithm very similar to "Quick
Sort". Despite many opinions to the contrary, I believe D-P is
suitable for polylines but not for polygons. A simple merging of
identical points works well enough. At different zoom levels, the
spread between adjacent points changes. Eventually, two adjacent
points occupy the same pixel. You could do a proximity test but I
doubt the extra math is worth it. Also, I believe CANVAS/SVG/VML may
do some internal point reduction.
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are sub...
Sorry, by LoD I mean Level of Detail, such as that computed by DP. We do not yet perform any compression in the browser, only LoD assignment, indexing and later vector extraction + clipping + rendering.
On Sep 25, 2009 12:05 AM, "bratliff" <brat...@umich.edu> wrote:On Sep 24, 1:52 am, Ben Appleton <apple...@google.com> wrote: > Not at all; we agree with your asse...
"LoD" ?
You are welcome to use any or all of my compression algorithm:
www.polyarc.us/polypack.js
It is bit based rather than byte based for a small gain in space. It
is pixel based (fixed point) rather than Lat/Lon coordinate based
(floating point) for a large gain in space. It is lossless within the
limitations of a 32 bit unsigned integer which is equivalent to zoom
level 24 with 256x256 pixels per tile.
The arbitrary ASCII alphabet avoids the use of the backslash
character. The actual alphabet can be negotiated between sender &
receiver for very weak encryption.
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are su...
For CANVAS, clipping is not required. Anything beyond the tile
On Sep 24, 8:43 pm, Ben Appleton <apple...@google.com> wrote:
> Sorry, by LoD I mean Level of Detail, such as that computed by DP. We do
> not yet perform any compression in the browser, only LoD assignment,
> indexing and later vector extraction + clipping + rendering.
boundaries is not rendered. It avoids having to interpolate
transitional segments (from outside to inside or from inside to
outside).
For riciculously large polys, I found it useful to do a quick
aggregation by tile. I call it a "skip list". For consecutive
verticies in the same tile, I keep their beginning & ending offsets.
To build an actual tile, the "skip list" can be used to bypass a large
number of verticies in one comparison. Dragging & panning do not
require the "skip list" do be rebuilt. Returning to a previously
visited zoom level will reuse an existing "skip list". I have
experimented with combining zoom levels in the same "skip list". It
means building fewer "skip lists" but at intermediate zoom levels the
"skip list" is not optimal.
I suppose you could quickly test the height of the triangle of each
set of three consecutive points without too much overhead. But what
if:
A-B-C says "discard B"
B-C-D says "discard C"
C-D-E says "discard D"
D-E-F says "discard E"
The result is A-F which might be an ugly looking line segment.
Additional analysis will overhead.
Thanks. Good to know. I will experiment with it. Right now, I am
On Sep 25, 3:14 am, Ben Appleton <apple...@google.com> wrote:
> > The only point reduction I do is to discard points collapsing into the
> > same pixel. I figure CANVAS which is complied can eliminate
> > extraneous points much quicker than JavaScript which is interpreted.
>
> I've found that calling Canvas .moveTo()/.lineTo() takes a non-trivial
> amount of time, so that removing unused vertices (which can be done once
> before rendering) speeds up rendering.
playing with an idea of generating one 1024x1024 tile which I will
clone into sixteen 256x256 tiles.
> > I suppose you could quickly test the height of the triangle of eachOK, but be aware it is not symmetrical in opposite directions which
> > set of three consecutive points without too much overhead. But what
> > if:
>
> > A-B-C says "discard B"
> > B-C-D says "discard C"
> > C-D-E says "discard D"
> > D-E-F says "discard E"
>
> > The result is A-F which might be an ugly looking line segment.
> > Additional analysis will overhead.
>
> Our current implementation is more like
> A-B-C says "discard B"
> A-C-D says "discard C"
> A-D-E says "don't discard D"; push vertex A
> D-E-F says ...
means two polys with a common boundary will compress differently. You
may see gaps and/or overlaps along their common boundary.
FWIW, some polys are filled but not stroked.
The constant line width
is the only thing preventing scaling between zoom levels.
Mousemove/over/out for the map canvas could just be attached to the container. So, what would you want these events to do that you cannot already do?
On Oct 5, 2009 3:01 AM, "bratliff" <brat...@umich.edu> wrote:On Sep 30, 6:43 pm, Esa <esa.ilm...@gmail.com> wrote: > On Sep 29, 11:41 pm, Esa <esa.ilm...@gmail....
"Pixel" could be interpreted several different ways:
Absolute (Relative to 0,0)
Relative to the container DIV
Relative to the slippery DIV with the tiles & polys
Pamela / Ben,
What about "mousemove", "mouseover", "mouseout" event handlers for the
map canvas ? If "no", I will have to do it myself. If "yes", I will
wait. Admittedly, such events are meaningless to iPhone users.
What about a way to disable iPhone "touch" / "mouse" emulation for
other browsers ? I am convinced it is the cause of the misdirected
clicks I am experiencing in:
www.polyarc.us/polycluster/examine.html
But it is difficult to prove without source code. I will try to block
your click event handler to see if it behaves correctly.
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are su...