[OpenLayers-Users] sphericalMercator
Armin Wäspy
armin.waespy at lubw.bwl.de
Mon Oct 15 05:29:07 EDT 2007
Hi everybody,
I'm new in openlayers and testing some WMS overlays.
I want to overlay a WMS over a google maps or yahoo map basic layer.
As long i know gm or ym are in sphericalMercator EPSG:900913
so i set the wms an epsg: 900913
as you see here:
http://rips-uis.lubw.baden-wuerttemberg.de/wms/cgi/GDI_SCHUTZGEBIET_NATUR?REQUEST=GetCapabilities&SERVICE=WMS
in my code are 2 wms layers. one with, one without EPSG:900913
the one without sends an error message "invalid SRS value" --> of course!
the one with correct EPSG don't show and no error messages
what's wrong?
can anybody help?
map:
http://rips-uis.lubw.baden-wuerttemberg.de/rips/wms_viewer/openlayer_test/myOpenLayer2.php
code:
var map, gmap, layer1, layer2, layer3;
function init(){
var options = {
projection: "EPSG:900913",
units: "m",
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
20037508, 20037508.34)
};
map = new OpenLayers.Map('map', options);
map.addControl(new OpenLayers.Control.LayerSwitcher({'div':OpenLayers.Util.getElement('layerswitcher')}));
map.addControl(new OpenLayers.Control.MousePosition());
// create Google Mercator layers
var gmap = new OpenLayers.Layer.Google(
"Google Streets",
{type: G_NORMAL_MAP, 'sphericalMercator': true}
);
map.addLayer(gmap);
//WMS-Layer
layer2 = new OpenLayers.Layer.WMS( "Naturraum", "http://rips-uis.lubw.baden-wuerttemberg.de/wms/cgi/UIS_0100000006900001", {layers: '0', transparent:'true'}, { 'isBaseLayer': false, 'opacity': 0.7 } );
layer3 = new OpenLayers.Layer.WMS( "Naturschutz", "http://rips-uis.lubw.baden-wuerttemberg.de/wms/cgi/GDI_SCHUTZGEBIET_NATUR", {layers: '0,1,2,3,4', transparent:'true', 'sphericalMercator': true}, { 'isBaseLayer': false } );
map.addLayers([layer2, layer3]);
map.setCenter(new OpenLayers.LonLat(1015000, 6200000), 8);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20071015/37c6834c/attachment.html
More information about the Users
mailing list