On Mon, Jan 25, 2010 at 6:54 PM, String <[email protected]>wrote:

> On Jan 24, 9:43 pm, Ben Appleton <[email protected]> wrote:
>
> > Custom map types intentionally do not wrap, as only the implementor knows
> if
> > and how their tiles wrap.
>
> I'd like to take issue with this. First, it's built-in to most map
> projections we use (specifically Mercator) that the "data" (imagery,
> or whatever) wraps horizontally; hence the
> MapCanvasProjection.getWorldWidth() method. So I think it's reasonable
> to assume that custom map types wrap, with a period of their
> associated projection's getWorldWidth().
>

Most projections, but not all.  Consider Google's new Aerial
imagery<http://googlegeodevelopers.blogspot.com/2009/12/getting-better-view-with-maps-api-v2.html>
-
when facing east or west this wraps vertically.  All that has changed from
v2 is that v3 allows custom MapTypes that do not wrap horizontally.

Second, even if you do want to leave it to the implementor, I don't
> see any way to tell MapType that it *should* wrap. IOW, if I have a
> custom map type which should wrap at the usual +/-180 degree
> antimeridian, how can I make that happen with the MapType class?
>

Longitude still wrap at +/- 180 degrees longitude, nothing has changed
there.  For example, longitude wraps at +/- 180 degrees longitude in Aerial
imagery, but when viewed from an east or west aspect the longitude lines are
rotated compared to normal maps so that longitude runs vertically.

Fortunately it is easy to wrap in your MapType implementation.  Say for
example that you have a MapType that at zoom 0 wraps horizontally after 1
tile.  Then your implementation of getTile might look like:

MyMapType.prototype.getTile = function(tileCoord, zoom) {
  var x = tileCoord.x % (1 << zoom);  // Wrap horizontally
  var y = tileCoord.y;
  var image = new Image;
  image.src = "http://my.server.com/tiles?x="; + x + "&y=" + y + "&zoom=" +
zoom;
  return image;
};

 String
>
> --
> 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
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-maps-js-api-v3%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>

-- 
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 [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-js-api-v3?hl=en.

Reply via email to