Hello Group!
I have created a small map, that should simply display a polygon that
spanns the whole world once.
First I had a few problems with large polygons when i crossed certain
borders (like the international date border i guess) but I managed to
draw a spanning polygon by dividing the edges of the polygon at the
half and shift the "bottom left" point a bit upwards.
I prevent the world from being repeated by overriding tileCheckRange
and getWrapWidth. Markers are also drawn just once, but polygons are
repeated, which looks quite arkward.

You can find the map/code at 
http://menedev.de/GMapSnippets/worldSpanningPolygon.html

The map behaves the same on IE8 and FF 3.5.5, Windows XP SP3.
(Opera only draws polygons when the map is moved and then draws the
same polygon over and over again, but I think thats normal).

So is there any way to prevent the Polygons from being redrawn?

JS Code for the polygon:

var color = "DDDDDD";

// the polygon is created around the center
// and subdivided along lat=0° and lng=0°
var w = 170;
var h = 85;
var he = 84.99;
var polygon = new GPolygon([
  new GLatLng(h, -w),
  new GLatLng(h, 0),
  new GLatLng(h, w),
  new GLatLng(0, w),
  new GLatLng(-h, w),
  new GLatLng(-h, 0),
  // also the "bottom left" point needs to be shifted
  new GLatLng(-h - 0.01, -w),
  new GLatLng(0, -w),
  new GLatLng(h, -w)
  ],
  color, 2, 0.0, color, 0.5, {clickable: false});
  map.addOverlay(polygon);

Any help is appreciated!

Greetings,
Mene

--

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