load GeoJSON from an external file

292 views
Skip to first unread message

MOHAMMED HABBOUB

unread,
May 15, 2015, 11:53:00 AM5/15/15
to leafl...@googlegroups.com
Dear all, 

Just new to leaflet,  I was doing a tutorial about loading GeoJSON from an external file, but it seems that something is wrong. I phave the the html, GeoJson, and jquery.js in the same folder. the three files are attached.
 
Anyone can help? 

jquery-2.1.1.min.js
leaflet070515.html
rodents.geojson

Alexandru Pufan

unread,
May 18, 2015, 2:53:24 AM5/18/15
to leafl...@googlegroups.com
What browser are you using? I've downloaded your files, and the geojson loads fine, using Firefox. 

MOHAMMED HABBOUB

unread,
May 18, 2015, 3:23:32 AM5/18/15
to leafl...@googlegroups.com
Google Chrome

--

---
You received this message because you are subscribed to a topic in the Google Groups "Leaflet" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/leaflet-js/bEIL7DSjD-w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to leaflet-js+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexandru Pufan

unread,
May 18, 2015, 4:27:31 AM5/18/15
to leafl...@googlegroups.com
If you're not working on a server, it has to do with this issue: http://stackoverflow.com/questions/4819060/allow-google-chrome-to-use-xmlhttprequest-to-load-a-url-from-a-local-file

You have two solutions: change your browser, or create a server with a program like WAMP ( http://wampserver.com/ )

MOHAMMED HABBOUB

unread,
May 18, 2015, 4:49:56 AM5/18/15
to leafl...@googlegroups.com
Thank you very much, Alexandru
I'll take the easiest option, switch to Firefox :D

On 18 May 2015 at 11:27, Alexandru Pufan <pufanal...@gmail.com> wrote:
If you're not working on a server, it has to do with this issue: http://stackoverflow.com/questions/4819060/allow-google-chrome-to-use-xmlhttprequest-to-load-a-url-from-a-local-file

You have two solutions: change your browser, or create a server with a program like WAMP ( http://wampserver.com/ )

--
Reply all
Reply to author
Forward
0 new messages