[OpenLayers-Users] OpenLayers 3 ServerVector

Bart van den Eijnden bartvde at boundlessgeo.com
Thu Aug 21 04:33:52 PDT 2014


Please ask ol3 questions on the ol3 mailing list instead:

https://groups.google.com/forum/#!forum/ol3-dev

Best regards,
Bart

Bart van den Eijnden
Front End Software Engineer | Boundless
bartvde at boundlessgeo.com
1-877-673-6436
@boundlessgeo



On 14 Aug 2014, at 15:46, terra map <terramap at avitarassociates.com> wrote:

> Hello all,
> 
> 
> I have the following code I am using to try and connect to a WFS service that will respond with GML features.  It seems to work as I can see the features in the DOM under xmlhttp, I can also use pSource.readFeatures(xmlhttp.response) to view them.  However nothing is displayed on the map.  Any guidance would greatly be appreciated.
> 
> Thanks in advance,
> 
> Chad
> 
> var pSource = new ol.source.ServerVector({
>               format: new ol.format.WFS({
>                 featureNS: 'http://fdo.osgeo.org/schemas/feature/ns108078613',
>                 featureType: 'Parcels',
>                 srsName: 'EPSG:3857',
>                 schemaLocation: 'http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/base/feature.xsd http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd'
>               }),
>               loader: function(extent, resolution, projection) {
>                         var url = 'http://localhost/mapguide/mapagent/mapagent.fcgi?REQUEST=GETFEATURE&SERVICE=WFS&VERSION=1.1.0&PROPERTYNAME=PID%2C+Geometry&MAXFEATURES=200&SRSNAME=EPSG:3857&TYPENAME=ns108078613%3AParcels&FEATUREID=&FILTER=&BBOX=&OUTPUTFORMAT=GML3';
>                         xmlhttp.open("GET", url, true);
>                         xmlhttp.send();
>               },
>               projection: 'EPSG:3857',
>              
>             });
> 
>           var parcels = new ol.layer.Vector({
>             source: pSource,
>             style: new ol.style.Style({
>               stroke: new ol.style.Stroke({
>                 color: 'color: rgba(156, 198, 182, 1);',
>                 width: 6
>               }),
>               fill: new ol.style.Fill({
>                 color: 'rgba(156, 198, 182, 0.4)'
>               })
>             })
> 
>           });
> 
>       var map = new ol.Map({
>         target: 'map',
> ////////////////////
>         layers: [
>           new ol.layer.Tile({
>             source: new ol.source.MapQuest({layer: 'sat'})
>           }),
>           parcels
>           ],
> //////////////////////////
>         view: new ol.View({
>           center: [-8069122.324214099, 5397167.024867109],
>           zoom: 10,
>           extent: [-8088575.41281466, 5379737.43765192, -8074025.78666561, 5397587.6602848]
>         }),
> //////////////////////////
>         controls: [
>         new ol.control.MousePosition({
>           target:'pos'
>         })
>         ]
> 
>       });
> 
> 
> 
> 
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20140821/ce6ef580/attachment.html>


More information about the Users mailing list