GetFeatureInfo and CORS

124 views
Skip to first unread message

Arnau Forner

unread,
Feb 20, 2015, 11:11:45 AM2/20/15
to leafl...@googlegroups.com
Hello,

I am pretty new in Leaflet. I am currently trying to create a little map-application with a WMS. I would like to click on the layer and
get a popup with the information of the clicked feature.

function httpGet(theUrl) {
    var xmlHttp = null;

    xmlHttp = new XMLHttpRequest();
    xmlHttp.open( "GET", theUrl, false );
    xmlHttp.send( null );
    return xmlHttp.responseText;
}

The URL is something like this
http://www.ign.es/wms-inspire/mdt?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&CRS=CRS:84&BBOX=-15.66650390625,32.82421110161336,8.173828125,46.81509864599243&WIDTH=1085&HEIGHT=834&LAYERS=EL.GridCoverage&QUERY_LAYERS=EL.GridCoverage&STYLES=&EXCEPTIONS=XML&FORMAT=image/png&INFO_FORMAT=text/html&FEATURE_COUNT=50&I=706&J=377

But I get this error, which I don't know how to solve despite the huge amount of info on the web about CORS:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource...

I am using Apache in my machine (localhost) and I don't have access to the machine serving the WMS.
Is there any way to get this to work?

Thanks

Arnau

anato...@gmail.com

unread,
Nov 19, 2015, 4:36:43 PM11/19/15
to Leaflet
Hi! You then decide how this problem?
Reply all
Reply to author
Forward
0 new messages