[OpenLayers-Users] OpenLayers/Leaflet+MapServer (WMS) - coordinate-problem

biff21 at gmx.de biff21 at gmx.de
Tue Sep 6 06:20:53 EDT 2011


Hello community,

I got a bad problem with coordinates. I tried to setup a raw MapServer WMS with OpenLayers frontend. My aim is to show measurement data from a database as a single tile with OpenLayers.

Some facts: OpenLayers: - Background-Map: OSM (new OpenLayers.Layer.OSM();) - requesting my MapServer WMS (new OpenLayers.Layer.WMS) with Single-Tile-Mode

MapServer: - Raw WMS - means I'm fetching the querystring by myself and trying to apply it to the map - No mapfile used - all settings in map-generating file itself

My problem is, that OpenLayers creates a querystring like that...

LAYERS->basic
FORMAT->image/png
PROJECTION->EPSG:4326
UNITS->m
SERVICE->WMS
VERSION->1.1.1
REQUEST->GetMap
STYLES->
EXCEPTIONS->application/vnd.ogc.se_inimage
BBOX->-11231962.682325,-2416633.0858313,19763558.029875,12161436.946106
WIDTH->1584
HEIGHT->745

...and mapserver has a method to set the bounding box from OpenLayers...

$Map->setExtent(lat1,lon1,lat2,lon2);

but the coordinates have a different format. OpenLayers provides coordinates in UTM(?) while setExtent expects decimal values as I often saw them in example scripts.

My question is: How can I create a map which fits perfectly with the OSM map, but without using a mapfile and tilemode since I need singletile-mode? I couldn't figure out to set the bounding box correctly or even convert the coordinates. Additionally I suppose that something is wrong with my projections.

BTW using leaflet causes the same problem. Coordinates look like bbox->1878516.4071364915,5635549.221409475,2504688.5428486555,6261721.35712164 while setExtent() needs decimal values (lat/lon)

I hope someone can help me.:) 
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de


More information about the Users mailing list