[OpenLayers-Users] WFS not displayed (GML looks fine)
wingmanzz
scott.stewart at nbtsolutions.com
Mon Jan 30 17:01:04 EST 2012
Hi
I have a problem with OpenLayers 2.11 talking to WFS server provided by an
ArcGIS 10.2 server. The XML comes back from the server properly (as far as I
can tell), the features are added to the map (173 of them show up when I
examine/debug the map object in Chrome), and the number of features grows
and shrinks as I would expect it to when I zoom in and out or pan to move
features our of the map extent, but there are no features shown at all. The
styles are the defaults styles, but I have tried other default styles to no
avail.
The points come back as such:
geometry: OpenLayers.Geometry.Point.OpenLayers.Class.initialize
bounds: OpenLayers.Bounds.OpenLayers.Class.initialize
id: "OpenLayers.Geometry.Point_145"
x: 4715701.3611736
y: -11422711.075058
What is going wrong here? I can post some GML from the GetFeature request if
it would help...
Code:
var map;
var layer;
var wfslayer;
var geographic = new OpenLayers.Projection("EPSG:4326");
var mercator = new OpenLayers.Projection("EPSG:900913");
var lon = -98.393;
var lat = 38.445;
var zoom = 4;
OpenLayers.ProxyHost = "/demo/simpleproxy.php?mode=native&url=";
var center_mercator =
OpenLayers.Layer.SphericalMercator.forwardMercator(lon, lat);
center_mercator_x = center_mercator.lon;
center_mercator_y = center_mercator.lat;
var options = {
projection: mercator,
units: "m",
maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
20037508.34, 20037508.34)
};
map = new OpenLayers.Map( 'map', options );
var osmLayer = new OpenLayers.Layer.OSM("OpenStreetMap");
osmLayer.projection = aliasproj;
map.addLayer(osmLayer);
wfslayer = new OpenLayers.Layer.WFS(
"OpenLayers WFS",
"http:/xxxxx/ArcGIS/services/RRNP/RRNP_NHAS_Federal_Partners_WFS/GeoDataServer/WFSServer?",
{
typename: "Fed_Partners",
extractAttributes: true,
version: "1.1.0",
srsName: "EPSG:4326"
},
{
projection: new OpenLayers.Projection("EPSG:4326"),
isBaseLayer: false,
extractAttributes: true
}
);
map.addLayer(wfslayer);
//no features until I refresh..
wfslayer.refresh();
// Add non-default controls to the map canvas
map.addControl(new OpenLayers.Control.MousePosition());
map.addControl(new OpenLayers.Control.LayerSwitcher());
// Set Map Center and Zoom Level
map.setCenter(new OpenLayers.LonLat(center_mercator_x,
center_mercator_y), zoom);
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/WFS-not-displayed-GML-looks-fine-tp4352042p4352042.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list