[OpenLayers-Users] Google map, antimeridian and bounding box

Guillaume Lom progmls at googlemail.com
Wed Jan 23 07:23:42 EST 2008


Hello,

I am trying to display some markers on a Google map layers, along with
bounding boxes.

All is well except in on particular case:

If I want to display a bounding box around Antartica, for instance, it
does not expand around all longitudes, but only around the
antimeridian, which means that I have a litte rectangle in the middle
of the sea instead of having a big one covering the whole antartica.

Is there a way to go around this while using google map? I could not find any...

Here are the relevant javascript bits:

var glayer = new OpenLayers.Layer.Google("Google Normal", { 'type':
G_NORMAL_MAP});
var params;
params.maxExtent=new OpenLayers.Bounds(-180,-90,180,90);
var _map = new OpenLayers.Map('map', params)
_map.addLayers([glayer]);
var boxes = new OpenLayers.Layer.Boxes("portalsBoxes");
_map.addLayer(boxes);
var bbounds = new OpenLayers.Bounds(-180, -90, 180, -61.4);
boxes.addMarker(new OpenLayers.Marker.Box(bbounds), 'red', 1);

Thanks for any help,
Guillaume



More information about the Users mailing list