简体   繁体   中英

Javascript code to download tiles from OpenStreetMap?

I need to download a small region tiles from OpenStreetMap. I need to it to be in Javascript. So, that i can download them when needed. I have seen some tile downloaders like JTile Downloader etc., they are standalone applications. How to download them into a folder , so that i can access them using any map api like leaflet, Openlayers etc.,

Kindly, suggest me a solution

Do you want to run the javascript in a browser? Than it is not possible to download files to your local filesystem using javascript (just google it).

If you can run the code using an environment like nodejs, you can download files quite easily: How to download a file with Node.js (without using third-party libraries)?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM