[OpenLayers-Dev] OverviewMap help

Paul Spencer pspencer at dmsolutions.ca
Wed Jun 27 19:46:37 EDT 2007


Hi,

looking for help configuring an overviewmap.  A quick explanation.   
My OL layers are not in a directly valid projection, they are  
displayed at a resolution of 1 in what is essentially pixel space.   
There is a geo2pix/pix2geo conversion that I can do to convert the  
position OL reports as the geographic extents/center into real  
geographic coordinates in SRS EPSG:26917.

I would like to add an overview map that points to a WMS service (for  
now).  I have subclassed the overview map to override the functions  
that convert between map space and the overview map space to insert  
my custom conversion.

I've got the overview map showing *something* but it is in the  
completely wrong location (as far as I can tell) and the tile set for  
the overview map is stuck with the bottom/left tile in the center on  
the map and no blue box!

I suspect that it is just a matter of me initializing the overview  
map wrongly, here is what the relevant code is:

// add keymap
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
     "http://www2.dmsolutions.ca/cgi-bin/mswms_gmap?",
     {SRS:'EPSG:26917',layers: ['bathymetry','road']} );


var options = {
   layers: [wms],
   mapOptions:{SRS: 'EPSG:26917', minResolution: 1, maxResolution:  
500000000},
   outsideViewport: true,
   size: new OpenLayers.Size(250, 250)
};
var overview = new OpenLayers.Control.OverviewMap.MapMobility(options);

the only visible tile is:

http://www2.dmsolutions.ca/cgi-bin/mswms_gmap?SRS=EPSG% 
3A4326&LAYERS=bathymetry,road&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&S 
TYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image% 
2Fjpeg&BBOX=-180%2C-90%2C243960.625%2C244050.625&WIDTH=256&HEIGHT=256

note that the SRS is wrong and the tile coordinates also seem  
suspicious (bottom left is -180 -90 but the projection is a meters  
projection).

I've tried so many combinations trying to get something to work that  
I am sure it is messed up now.

TIA

Cheers

Paul

+-----------------------------------------------------------------+
|Paul Spencer                          pspencer at dmsolutions.ca    |
+-----------------------------------------------------------------+
|Chief Technology Officer                                         |
|DM Solutions Group Inc                http://www.dmsolutions.ca/ |
+-----------------------------------------------------------------+








More information about the Dev mailing list