[OpenLayers-Users] wms layer over openstreet base map
jdmorgan
jdmorgan at unca.edu
Thu May 24 14:12:27 PDT 2012
Hola Gery,
That does help and I have been able to narrow the problem down a bit
more. I think this has to do w/ the fact that I am attempting to load a
wms layer and there isn't an entry for the item in epsg file. I
gathered this from the following page
I have now added the epsg for 900913 but I am still having an issue. I
was able to get an error back from the wms server which is:
<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
<!DOCTYPE ServiceExceptionReport SYSTEM
"http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">
<ServiceExceptionReport version="1.1.1">
<ServiceException code="InvalidSRS">
msWMSLoadGetMapParams(): WMS server error. Invalid SRS given : SRS must
be valid for all requested layers.
</ServiceException>
</ServiceExceptionReport>
Thanks,
Derek
On 5/24/2012 1:46 PM, Gery . wrote:
>
> Hello,
>
> I think you're right, projection has something to do there, this link
> may help you:
> http://blog.sonxurxo.com/2011/04/28/tutorial-de-openlayers-ii-capas-de-google/
>
> There is a lot of stuff about google maps and openlayers and
> projection, just google them.
>
> Hope this helps,
>
>
>
> > Date: Thu, 24 May 2012 13:37:52 -0400
> > From: jdmorgan at unca.edu
> > To: openlayers-users at lists.osgeo.org
> > Subject: [OpenLayers-Users] wms layer over openstreet base map
> >
> > Hello,
> > I am trying to get a wms states layer to overlay on a base openstreet
> > map. The openstreet map shows up fine but the wms layer never does. I
> > am guessing this is a projection issue but can't figure out how to
> > resolve it. Any tips would be greatly appreciated. Here is my code:
> >
> > <!DOCTYPE HTML>
> > <html>
> > <head>
> > <title>OpenLayers Demo</title>
> > <style type="text/css">
> > html, body, #basicMap {
> > width: 100%;
> > height: 100%;
> > margin: 0;
> > }
> > </style>
> > <script src="http://www.openlayers.org/api/OpenLayers.js"></script>
> > <script>
> > function init() {
> >
> > map = new OpenLayers.Map("basicMap", {projection: "EPSG:900913"});
> > var mapnik = new OpenLayers.Layer.OSM();
> > var fromProjection = new OpenLayers.Projection("EPSG:4326");
> > // Transform from WGS 1984
> > var toProjection = new OpenLayers.Projection("EPSG:900913");
> > // to Spherical Mercator Projection
> > var position = new OpenLayers.LonLat(-98.0859375,
> > 39.095962936305476).transform(fromProjection, toProjection);
> > var zoom = 5;
> >
> > var stateMap = new OpenLayers.Layer.WMS(
> > 'States',
> > 'http://pathToWMSlayer/vlayers',
> > {layers: 'states', transparent: true}
> > {
> > isBaseLayer: false,
> > }
> > );
> >
> > map.addLayers([mapnik, stateMap]);
> > map.setCenter(position, zoom);
> > }
> > </script>
> > </head>
> > <body onload="init();">
> > <div id="basicMap"></div>
> > </body>
> > </html>
> >
> >
> > Thanks ahead of time,
> > Derek
> > _______________________________________________
> > Users mailing list
> > Users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/openlayers-users
--
Derek @ NEMAC
http://nemac.unca.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120524/7af6f2b3/attachment-0001.html
More information about the Users
mailing list