[OpenLayers-Users] Google and WMS Layers - Projection help
Shawn Oatley
shawn at niagarafalls.ca
Tue May 12 20:49:51 EDT 2009
Hello,
Please bear with me as I am just getting into OpenLayers and I am a web programmer, not a GIS person. I am having difficulty getting different types of layers to work together.
Our drawings are in UTM 17N and the WMS Server seems to work fine when using a projection of EPSG:4326. (Please forgive me if I am not speaking in the correct terms).
I have been able to successfully get most of our drawing layers to work with OpenLayers, but have had tremendous problems with VE layers. I won't be surprised if it is a projection issue, but I don't know enough about GIS to know how to fix it.
Here is a snip of my OpenLayers config:
function init() {
OpenLayers.IMAGE_RELOAD_ATTEMPTS = 5;
options = {
projection: new OpenLayers.Projection("EPSG:4326"),
displayProjection: new OpenLayers.Projection("EPSG:4326"),
maxExtent: new OpenLayers.Bounds(-79.287519, 42.920835, -78.956522, 43.156),
tileSize: new OpenLayers.Size(256, 256),
maxResolution: 2 / 256,
numZoomLevels: 15,
controls: [new OpenLayers.Control.LayerSwitcher(),
new OpenLayers.Control.MouseDefaults(),
new OpenLayers.Control.MousePosition(),
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.OverviewMap(),
new OpenLayers.Control.KeyboardDefaults(),
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.Permalink(),
new OpenLayers.Control.ScaleBar()]
};
map = new OpenLayers.Map('map', options);
var bkgrd = new OpenLayers.Layer.WMS("Background",
http://wmsServer,
{ layers: "BaseDrawing",
format: "image/png",
transparent: false
},
{ transitionEffect: "resize" }
);
var nasa = new OpenLayers.Layer.WMS(
"NASA Global Mosaic",
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
{ layers: "landsat7" }
);
var parcels = new OpenLayers.Layer.WMS("Parcels",
"http://wmsServer",
{ layers: "ParcelsDrawing",
format: "image/png",
transparent: true
},
{ visibility: true,
transitionEffect: "resize",
minResolution: 0.00000095367431640625,
maxResolution: 0.000244140625
}
);
map.addLayers ([bkgrd,nasa,parcels]);
if (!map.getCenter()) {
map.zoomToMaxExtent();
}
}
There are a bunch of other layers that I add and controls, etc... but I didn't include them so that this won't be too long of a post.
I have tried putting the projection as 900913 but all that does is make my coordinates go all screwy. Right now, the internal site works pretty good, the parcels layer respects the min/max res, but I can't get any imagery to work on it.
Actually, the NASA imagery works fine, but I can't get any sort of Google/VE to work. I have tried including the sphericalMercator: true in the Google/VE layers, but that didn't seem to help. I have tried the examples on Openlayers' website for the VE examples but that didn't help either.
Any suggestions or pointers in the right direction would be awesome.
Thanks,
Shawn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090512/602d9bee/attachment.html
More information about the Users
mailing list