Hi–
I’m having some difficulty getting GeoServer to do reprojection to an Albers Equal Area map. I think the correct codes are EPSG: 42303 and 45556 (though I could be wrong).
As a test, I’m using the states data that comes with Geoserver.
I’ve tried both WMS and WFS.
Here’s the code:
var map;
function init(){
map = new OpenLayers.Map(‘map’,{projection: new OpenLayers.Projection(“EPSG:42303”)}); // Note that I’ve also tried 45556
var political = new OpenLayers.Layer.WMS(
“State”,
“/geoserver/wms”,
{layers: ‘topp:states’,
format: ‘image/png’}
);
var states= new OpenLayers.Layer.WFS(
“States”,
“/geoserver/wfs”,
{typename: ‘topp:states’},
{
typename: ‘states’,
featureNS: ’ http://www.openplans.org/topp’,
extractAttributes: false,
isBaseLayer: true
}
);
states.style = OpenLayers.Util.applyDefaults({strokeColor: “#0000ff”},
OpenLayers.Feature.Vector.style[“default”]);
map.addLayers([political,states);
I’ve done testing just showing one layer at a time and here’s what happens:
1.political (WMS) with EPGS: 42303
Displays nothing. I se a JS error message:
userAgentButton is null
_hasString()()OpenLayers.js (line 224)
OpenLayers.js()()OpenLayers.js (line 223)
var factory=null;if(typeof GearsFactory!..documentElement.appendChild(factory);}}}
2.states (WFS) with EPGS: 42303
I see the state outlines but it’s not an Albers projection.
3.political (WMS) with EPGS: 45556
I see the same JS error as in case 1, query to the db happens and I only see Kansas.
Note that if I remove the projection from OpenLayer.Map(… it works fine.
4.states (WFS) with EPGS: 45556
Same as case 2, no Albers projection.
Any help and advice is greatly appreciated.
– Ethan