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 ...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. I hope someone can help me.:) asked 05 Sep '11, 16:29 Sannifrosch |
Your coordinates seem to be in spherical mercator (900913, EPSG 3857) but you need them in lat/lon. You have to transform them for the querystring. Openlayers offers functions for this. answered 07 Sep '11, 11:59 dieterdreist |
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)