[OpenLayers-Users] Connecting to MapGuide via WFS
Rich Bauer
rdbauer at gmail.com
Mon Jun 17 06:25:36 PDT 2013
Thanks for the info. I looked and from what I can tell, MapGuide does
support this. I can return a XML output using something like this:
http://localhost/mapguide/mapagent/mapagent.fcgi?request=GetFeature&service=WFS&version=1.1.0&typeName=ns34414117:Parcels&MaxFeatures=10
I have simplified the data being loaded to the WMS layer above and the WFS
layer created from it. The error I get is:
1. OPTIONS
http://localhost/mapguide/mapagent/mapagent.fcgi?USERNAME=Administrator&Password=adminOrigin
null is not allowed by Access-Control-Allow-Origin.
XMLHttpRequest.js:220<file:///Z:/MapGuideProjects/MobileGIS/RBAC%20Mobile%20GIS/lib/OpenLayers/Request/XMLHttpRequest.js>
1. fXMLHttpRequest_sendXMLHttpRequest.js:220<file:///Z:/MapGuideProjects/MobileGIS/RBAC%20Mobile%20GIS/lib/OpenLayers/Request/XMLHttpRequest.js>
2. cXMLHttpRequest.sendXMLHttpRequest.js:262<file:///Z:/MapGuideProjects/MobileGIS/RBAC%20Mobile%20GIS/lib/OpenLayers/Request/XMLHttpRequest.js>
3. (anonymous
function)Request.js:233<file:///Z:/MapGuideProjects/MobileGIS/RBAC%20Mobile%20GIS/lib/OpenLayers/Request.js>
XMLHttpRequest cannot load
http://localhost/mapguide/mapagent/mapagent.fcgi?USERNAME=Administrator&Password=admin.
Origin null is not allowed by Access-Control-Allow-Origin.
index.html:1<file:///Z:/MapGuideProjects/MobileGIS/RBAC%20Mobile%20GIS/index.html#mappage>
<file:///Z:/MapGuideProjects/MobileGIS/RBAC%20Mobile%20GIS/index.html#mappage>
<file:///Z:/MapGuideProjects/MobileGIS/RBAC%20Mobile%20GIS/index.html#mappage>
This is showing up immediately after the last *.js file is loaded. I
thought I had read somewhere about this but can't remember where and what
it said and of course can't find it again. Any thoughts?
As far as the mobile.js, yes, I noticed that I had to use the "regular"
Openlayers.js for that to even attempt to work. I will just try to include
the individual script and see if that works rather than creating my own
build (for now).
On Mon, Jun 17, 2013 at 4:35 AM, Mark Prins <mc.prins at gmail.com> wrote:
> 2013/6/14 Rich Bauer <rdbauer at gmail.com>:
> >.... Code below:
> >
> > var wmsParcels = new OpenLayers.Layer.WMS("Parcels",
> >
> > "
> http://localhost/mapguide/mapagent/mapagent.fcgi?USERNAME=Administrator&Password=admin
> ",
> > { layers: 'Samples/Sheboygan/Layers/Parcels', transparent: true
> },
> > { isBaseLayer: false, transitionEffect: 'resize', format:
> > 'image/png' }
> > //{ projection: new OpenLayers.Projection('EPSG:900913') }
> > );
> >
> > map.addLayer(wmsParcels);
> >
> > var wfsParcels = new OpenLayers.Layer.Vector("WFS Parcels", { protocol:
> new
> > OpenLayers.Protocol.WFS.fromWMSLayer(wmsParcels) });
>
> I think (but I could well be wrong...) this was developed and tested
> with Geoserver. the WMS needs to support GML getfeatureinfo responses
> that exports the featuretype I'm not sure that mapguide does this.
>
> > map.addLayers([select, wfsParcels]);
> >
> > With this there are no errors showing up in Chrome Developer tools.
> >
> > As a related issue, when I use the above code, I get the error below if I
> > use the OpenLayers.movile.js script instead of the OpenLayers.js?mobile
> > script.
> >
> > Error:
> >
> > Uncaught Unsupported WFS version: 1.1.0 OpenLayers.mobile.js:515
>
> this seems clear enough, there is no WFS 1.1.0 support... when you
> look at the build profile[1] you can see there is only
> OpenLayers/Protocol/WFS/v1_0_0.js
> You need to make your own build.
>
> [1] https://github.com/openlayers/openlayers/blob/master/build/mobile.cfg
>
>
>
>
> --
> Disclaimer;
> This message is just a reflection of what I thought at the time of
> sending. The message may contain information that is not intended for
> you or that you don't understand.
> _______________________________________________
> 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/20130617/64452846/attachment-0001.html>
More information about the Users
mailing list