On Mar 3, 2:44 pm, bratliff <bratl...@umich.edu> wrote:
> On Mar 3, 1:10 pm, bratliff <bratl...@umich.edu> wrote:
>
> > How do you repaint a dirty rectangle if your markers are not
> > rectangular without clobbering other markers in the same rectangle ?
> > Are you using "drawImage" to copy a prototype marker into the tile ?
> > Does it handle overlapping colors & opacities correctly ?  What
> > "globalCompositeOperation" do you use ?
>
> I guess you could use an irregular clipping path.  I assumed
> "drawImage" used an implicit "globalCompositeOperation" of "COPY".  I
> admit I have not really experimented with it.  I know Opera's
> "globalCompositeOperation" is inconsistent with other browsers.

OK - I believe I have figured it out.

You use "drawImage" to extract the dirty rectangle into a detached
CANVAS element.  You save it for later replacement.  You also make
another detached copy of the same rectangle for temporary changes.
You paint your changes into one of the copies.  You use "drawImage" to
exchange copies in response to "mouseover" / "mouseout".  You use a
"globalCompositeOperation" of "COPY" to cover up any crap underneath
your marker.

I have a trick you might consider.  I have not actually implemented it
but I believe it will work.

Suppose your tile size is 256 x 256 pixels.  Suppose your marker with
all of its paraphernalia (shadow, etc.) is 40 x 40 pixels.  Suppose
the center of your marker happens to coincide with pixel 0:0 of a
particular tile.  You could break your marker into four pieces in four
different tiles.  Alternatively, you could use larger overlapping
tiles.

For each tile:

    style.left=(tileX*256-20)+"px";
    style.top=(tileY*256-20)+"px";
    style.width="296px";
    style.height="296px";

The marker resides entirely in one tile.  The overlapping area of
adjacent tiles is transparent.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to