Saturday, 23 November 2019

web mapping - Access-Control-Allow-Origin error in web map


I am having trouble getting a WFS layer working using Geoserver, OpenLayers and GeoExt.



I get the following error:


XMLHttpRequest cannot load http://10.0.0.155/geoserver/wfs. Origin http://10.0.0.155:8080 is not allowed by Access-Control-Allow-Origin.


Does anyone know how I get around this? I can't find anything in the examples for geoserver, openlayers or geoext.


I don't get any errors when using WMS on my maps.


Many thanks,


James



Answer



I think this is this problem http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#ProxyHost


so you need to set up a proxy host as per those instructions.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...