I want to create a mash-up that shows sites in Italy on a basemap. With the AJAX call I want to include the number of earthquakes within a certain distance to each site. I want to use the AJAX call for receiving and filtering the data. How can I do it?


1 Answer 1


Reason why $.ajax call does not work is missing &outputFormat=application/json parameter in the WFS url, so returned result is not JSON and so $.ajax rejects it. Since you don't have error function defined for $.ajax, error is simply ignored.

So WFS url should be:

url: 'https://emidius.mi.ingv.it/services/italy/wfs?service=wfs&version=2.0.0&request=GetFeature&typename=italy:CPTI15_v2&cql_filter=DWITHIN(geom,Point(' + lat + '%20' + lon + '),50,kilometers)&outputFormat=application/json&srsname=EPSG:4326'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.