traffordDataLab / leaflet.reachability

Plugin for the Leaflet JavaScript library to show areas of reachability based on time or distance for different modes of travel using the openrouteservice isochrones API.
MIT License
64 stars 7 forks source link

Run the leaflet.reachability_example.html from local folder? #3

Closed ragapack closed 5 years ago

ragapack commented 5 years ago

Hi, I am tested the example file from you link https://www.trafforddatalab.io/leaflet.reachability/leaflet.reachability_example.html works perfect on my notebook. After this I downloaded the Code as zip file from GitHub, unzipped the folder and run the example from there. The map opens, you Plugin is loaded and show all Options. But when I click on the map to draw the isochrones nothing happens, only the pencil button stay's red for a Moment. captura de tela 2018-11-11 16 06 04 How I can run your example file from a local folder? Thanks Thomas

ragapack commented 5 years ago

Hi, Now I saw it works OK with Google Chrome Browser but not with MS Edge Browser in a local folder. The older IExplorer asks before running ActiveX Script.

captura de tela 2018-11-12 00 30 27 But if you confirm the security Question it works fine too

itsozz commented 5 years ago

Hi Thomas,

Thanks very much for your interest in the plugin and for bringing the issue of MS Edge to my attention. I will look into this as soon as possible.

Regarding the running of the example from a local folder, when you choose a point on the map to create a reachability area, the plugin makes a call to the openrouteservice isochrones API. The two key aspects involved in this call are AJAX and CORS which require the code to be running from a web server, as opposed to viewing an HTML page in the browser as you would an image or document in a suitable viewer application. When developing locally you can set up a local web server which is usually accessed in the browser as http://localhost or similar, allowing you to run the code in the same way as it will be once it is hosted on the web. Development environments and setups are many and varied so we haven't included this aspect within the documentation as it's usually very much a matter of personal taste and influenced by the operating system you are using.

itsozz commented 5 years ago

Hi Thomas,

I checked the example in MS Edge and everything works fine - so long as it is running from a web server for the reasons described above. I hope my response made sense and you are able to do what you need. I'll close this issue but please feel free to get in touch if you need anything further.