AW: [OpenLayers-Users] Showing EPSG:25832 Map via OpenLayers

Arnd Wippermann arnd.wippermann at web.de
Tue Apr 5 14:11:43 EDT 2011


Hi,

With OpenLayers you can display layers in every projection you want. You
need proj4.js only if you want transform vector features from one projection
to another. For WMS layers you don't need it.

The piece of code should work. The extent are reasonable for EPSG:25832.

It seems, that the configuration of your WMS is not correct.

That it principal should work, I have taken your bounds and created a map in
EPSG:28532.
http://gis.ibbeck.de/OLClient/OLClient.asp?WMC=./data/WMC/epsg_25832_trento.
wmc.xml

Arnd

-----Ursprüngliche Nachricht-----
Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von jpvalappil
Gesendet: Dienstag, 5. April 2011 15:21
An: users at openlayers.org
Betreff: [OpenLayers-Users] Showing EPSG:25832 Map via OpenLayers

Hi All,

I have enabled WMS service in my mapserver and my map file contains all the
necessary information to make WMS service run correctly. The Projection used
within the map file is "EPSG:25832", both map and layers uses this
projection. I have also made a GetCapabilities request and it does not
contains any warning at all. Also viewed the map through the following URL: 

http://localhost:8080/cgi-bin/mapserv.exe?MAP=C:/ms4w/Apache/htdocs/map_demo
_5.0/FarSystems_5_0.map&LAYERS=ALL&MODE=MAP

The map is loading correctly.

I have a piece of JS code that tries to load the WMS map via OpenLayers:

var map, l1;
window.onload = function () {
    var options = {
        projection: new OpenLayers.Projection("EPSG:25832"),
        displayProjection: new OpenLayers.Projection("EPSG:4326"),
        units: 'm',
        maxExtent: new OpenLayers.Bounds(644773, 5093382, 681804, 5113322),
        maxResolution: 'auto'
    };
    map = new OpenLayers.Map("map", options);
    l1 = new OpenLayers.Layer.WMS("a",
"http://192.168.0.14:8080/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/map_
demo_5.0/FarSystems_5_0.map",
{
        layers: 'ortofoto2009',
        buffer: 5,
        transparent: 'true',
        format: 'image/png'
    }, {
        isBaseLayer: true,
        visibility: true
    });

    map.addLayer(l1);
    map.zoomToMaxExtent()
}

As I am not sure whether we can show a map based on projection "EPSG:25832"
I am trying to show a map based on the normal(default) projection
"EPSG:4326". But in my web page no map comes (the pan/zoombar comes).

I have included proj4js source file in my web page already and created a
file named EPSG25832.js in the def folder. The file contains the following
details:

Proj4js.defs["EPSG:25832"] = "+proj=utm +zone=32 +ellps=GRS80 +units=m
+no_defs";

My only objective is to show the map without changing the projection used in
my map file, which is "EPSG:25832". In the browser I am ready to use any
projection that is working and would be grateful if I can use "EPSG:25832"
projection even for the OpenLayers map.

Plz do help me to solve this issue.

-----
Thanks in advance

Jayaprakash

India
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Showing-EPSG-25832-Map-via-OpenLayers
-tp6242243p6242243.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list