On Aug 28, 9:26 pm, Paul Kulchenko <[email protected]> wrote:
> I'm writing visualization using canvas and would like to align my
> canvas objects with map tiles. Right now I'm using GTileLayer and
> toDataUrl to generate data: URLs and everything works fine.
> Unfortunately, one of my target platforms doesn't support toDataUrl,
> so I need to find some other mechanism.
>
> I'm considering generating one canvas per tile and the problem is with
> aligning my elements with the tiles; every generated image has this
> style:
>
> <img style="border: 0px none ; margin: 0px; padding: 0px; position:
> absolute; left: 315px; top: -149px; width: 256px; height: 256px; -moz-
> user-select: none; opacity: 0.5;"
>
> I'm after these "left: 315px; top: -149px;" coordinates to position my
> object in exactly the same way as this particular tile. Is there a way
> to find the image for a tile (its DOM object) based on having tile.x,
> tile.y and zoom information without doing brute force scanning of
> "map" element children searching for images with the right src value?
>
> Also these coordinates seem to change when the map is moved (not with
> every move, but when new tiles are loaded). I can probably have
> DOMListener to handle that, but the same question remains: how do I
> find what new coordinates are assigned to the tile that my particular
> div/canvas is covering?
>
> Is there a better way to align my elements with tiles? I wish there
> was a getTileDiv as there is getTileURL.
>
> Paul.

Some V3 examples of tile aligned CANVAS elements constructed on the
fly:

Simple

    14,000 vertices
    www.polyarc.us/polycluster/alaska.html
    41,000 vertices
    www.polyarc.us/polycluster/absurd.html

Advanced

    20,000 vertices
    www.polyarc.us/polycluster/canada.html
   110,000 vertices
    www.polyarc.us/polycluster

Similar arithmetic with less optimization can be found in the
following:

    www.polyarc.us/sparsetile.js

It does not handle the International Date Line cross over correctly.

I believe

    www.polyarc.us/polycluster.js

compensates correctly.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to