[OpenLayers-Users] WFS can't be shown. Can any one help me?

Arnd Wippermann arnd.wippermann at web.de
Fri Aug 1 12:41:09 EDT 2008


Hi,
 
have you considered this:
http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#ProxyHost
 
Arnd Wippermann

 
  _____  

Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von lorkyo
Gesendet: Freitag, 1. August 2008 17:00
An: users at openlayers.org
Betreff: [OpenLayers-Users] WFS can't be shown. Can any one help me?


I wrote a page to show wms and  wfs, at the same time, but I can't get the
WFS data show. the codes are listed below.It can only show the WMS data , I
exchange the place of "topp:tasmania_water_bodies" and
"topp:tasmania_state_boundaries", then it can only show the
"topp:tasmania_state_boundaries"(WMS). I have check  the checkbox of the
layerswitch,and these two layers is the of the same place and have the same
SRS, I have used udig to open them:
 
var map, layer;
map = new OpenLayers.Map('map', {controls:[], 'projection': 'EPSG:4326',
'units':'degrees'}); 
  OpenLayers.IMAGE_RELOAD_ATTEMPTS = 5;
          
          var bounds = new
OpenLayers.Bounds(143.60260815000004,-43.851764249999995,148.71135685000002,
-39.370182750000005)
  // setup untiled layer
          untiled = new OpenLayers.Layer.WMS.Untiled(
            "", "http://192.168.6.140:8080/geoserver/wms",
            {
              layers: 'topp:tasmania_water_bodies',
              styles: '',
              height: '382',
              width: '800',
              srs: 'EPSG:4326',
              format: 'image/png'
            },
               {maxExtent: bounds, maxResolution: 0.019956049609374915,
projection: "EPSG:4326"}
          );
          untiled.ratio=1;
          untiled.setVisibility(false, false);
       map.addLayer(untiled);
       var roads = new OpenLayers.Layer.WFS(
                "Roads (WFS)", 
                "http://192.168.6.140:8080/geoserver/wfs?",
                {   
               layers: 'topp:tasmania_state_boundaries',
                request: 'GetFeature',
                    maxfeatures: 100, visibility:true
                  },
 {maxExtent: bounds, maxResolution: 0.019956049609374915, projection:
"EPSG:4326"});
       map.addControl(new OpenLayers.ControlPanZoomBar({div:$('nav')}));
          map.addControl(new OpenLayers.Control.MouseDefaults());
          map.addControl(new OpenLayers.Control.Scale($('scale')));
          map.addControl(new OpenLayers.Control.MousePosition({element:
$('position')}));
          map.addControl(new OpenLayers.Control.LayerSwitcher());
          map.addControl(new OpenLayers.Control.OverviewMap());
          map.zoomToExtent(bounds);
          
 
lorkyo

 


  _____  

22Ôª³¬Öµ·¹Ãæ,8.5ÕÛ´¿Õä±ÈÈø,±Øʤլ¼±ËÍÍøÉϵã²ÍÓŻݶà
<http://popme.163.com/link/004584_0708_6957.html> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080801/64c9589c/attachment.html


More information about the Users mailing list