If you use WFS 1.0.0 the srsName
parameter is not supported, so you can’t use OpenLayers to decide in which projection you want your features returned. Therefore you'll need 1.1.0
Also you need to request the WFS in the same SRS as your basemap otherwise no features will appear as they will be outside the map's bounding box. So the srsName should be set to EPSG:900913 (not EPSG:900918 as in your question - a typo maybe?).
Finally you need to make sure that Geoserver can reproject the WFS into EPSG:900913. You can check this by issuing a request similar to:
http://localhost/geoserver/wfs?service=WFS&request=GetCapabilities&version=1.1.0
I had similar issues with MapServer rather than GeoServer, but the same principles probably apply:
http://geographika.co.uk/mapserver-openlayers-and-the-wfs-maze
You can reproject features on the client side, but this may take longer than doing it on the server. You will also need to include the Proj4JS library in your web application and the EPSG:26918 definition in your code to take this approach. You'll also need to set the layers's projection:
Proj4js.defs["EPSG:26918"] = "+proj=utm +zone=18 +ellps=GRS80 +datum=NAD83 +units=m +no_defs";
var myproj =new OpenLayers.Projection("EPSG:26918");
var wfsLayer = new OpenLayers.Layer.Vector(
"Photo Points", {
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.WFS({
version: "1.0.0",
url: "http://localhost/geoserver/wfs",
featureType: "Photo Point",
srsName:"EPSG:26918",
featureNS: "http://dev.geodatabase.org",
geometryName: "SHAPE"
}),
visibility: true,
projection: myproj
});
Have a look at the source in this example - http://openlayers.org/dev/examples/wfs-reprojection.html for more details.
Also you may want to change the strategy to BBox or you will load all the features in in one go.
strategies: [new OpenLayers.Strategy.BBOX()]
Best Answer
Unless your doing some fancy client side geometry editing or client side styling you should use WMS instead. GetFeatureInfo is a WMS request. If you use WMS you can make a custom template in Geoserver to return formatted HTML with your attributes:
http://docs.geoserver.org/latest/en/user/tutorials/GetFeatureInfo/index.html
The GetFeatureInfo HTML (if you use HTML templates) can easily be rendered to a popup dialog.
Not a popup, but shows the concept of GetFeatureInfo: http://openlayers.org/en/v3.2.0/examples/getfeatureinfo-tile.html
Some HTML to get you started:
And Javascript: