Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem using test.geojson "external" #22

Open
cesaregerbino opened this issue Apr 25, 2014 · 1 comment
Open

Problem using test.geojson "external" #22

cesaregerbino opened this issue Apr 25, 2014 · 1 comment

Comments

@cesaregerbino
Copy link

Hi Calvin!
I'm trying to use your library starting from https://github.com/calvinmetcalf/leaflet-ajax/blob/master/example/index.html and using the test.geojson on my pc.

My page is under http://localhost:80 and I tried to put the geojson file both under localhost:80 (apache here ...), and localhost:8080 (tomcat here .....).

The code of index,html is the same as you example, I've only changed here .....

var jsonTest = new L.GeoJSON.AJAX("test.geojson",{onEachFeature:popUp});
var jsonpTest = L.geoJson.ajax("http://localhost:8080/test.geojson",{onEachFeature:popUp,dataType:"jsonp"});

so you can replicate if you want.

I can't show the markers when active the jsonp layer: markers are ok activating the json layer. Using firebug I can see the json response but I note that I've

invalid label
{"type": "FeatureCollection", "features": [{"geometry": {"type": "Point", "coord...

referring ti the http://localhost:8080/test.geojson,

Any suggestion? Thank you very much in advance

Cesare

@calvinmetcalf
Copy link
Owner

so you need to make sure your server is serving it as jsonp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants