How to create offline maps using leaflet?

12,381 views
Skip to first unread message

Abhiram Ampabathina

unread,
Apr 13, 2013, 4:38:17 AM4/13/13
to leafl...@googlegroups.com
Hello,
  I am abhiram. I would like to create offline maps using leaflet . Is it possible ? Could you suggest some ideas here, kindly.

Best,
Abhiram

Brad McCarron

unread,
May 28, 2013, 9:19:46 AM5/28/13
to leafl...@googlegroups.com
Hi Abriham,

You would need to download a map of the world from http://www.openstreetmap.org/ and the leaflet api files.

I'm not exactly sure how to host the map tiles obtained from openstreetmap, but their site might offer some guidance.

Chris Hill

unread,
May 28, 2013, 9:26:01 AM5/28/13
to leafl...@googlegroups.com
It is important to *not* download the tiles from the Openstreetmap site. There is a policy to prevent tile scraping which is damaging to the performance of the OSM servers. You can download the planet as data, or part of it, and render your own tiles to use as you want to, but this is not a trivial process. More info at http://switch2osm.org

Cheers, Chris
---
cheers, Chris
osm user, chillly

Brad McCarron

unread,
May 28, 2013, 9:54:51 AM5/28/13
to leafl...@googlegroups.com
Abriham,

I'm not familiar with the scraping Chris is talking about, but please don't think I misdirected you.

The link to download the maps is in fact hosted by openstreetmap and available at the following sub-domain:

http://planet.openstreetmap.org/

You will find the same link on the main openstreetmap.org webpage which I correctly directed you to in my first post.

Please see the left pane where it says: The data is free to download and use under its open license.

Just click download and it will take you to planet.openstreetmap.org.

...............



On Saturday, April 13, 2013 4:38:17 AM UTC-4, Abhiram Ampabathina wrote:

Arnie Shore

unread,
May 28, 2013, 10:17:38 AM5/28/13
to leafl...@googlegroups.com
Abhiram, whatever the source of the map data, you shd plan on its
offline storage in accordance with the following
standard/specification:

http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification

I've done so in our application, and at run-time, a simple Javascript
Boolean identifies the source of the data, switching between
offline/local and OSM proper. The balance of the application neither
knows nor cares re the source.

HTH

On 5/28/13, Brad McCarron <mist...@gmail.com> wrote:
> Abriham,
>
> I'm not familiar with the scraping Chris is talking about, but please don't
>
> think I misdirected you.
>
> The link to download the maps is in fact hosted by openstreetmap and
> available at the following sub-domain:
>
> http://planet.openstreetmap.org/
>
> *You will find the same link on the main openstreetmap.org webpage which I
> correctly directed you to in my first post.*
>
> Please see the left pane where it says: The data is free to
> download<http://planet.openstreetmap.org/>and
> use <http://wiki.openstreetmap.org/wiki/Using_OpenStreetMap> under its open
>
> license <http://www.openstreetmap.org/copyright>.
>
> Just click download and it will take you to planet.openstreetmap.org.
>
> ...............
>
>
> On Saturday, April 13, 2013 4:38:17 AM UTC-4, Abhiram Ampabathina wrote:
>>
>> Hello,
>> I am abhiram. I would like to create offline maps using leaflet . Is it
>>
>> possible ? Could you suggest some ideas here, kindly.
>>
>> Best,
>> Abhiram
>>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Leaflet" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to leaflet-js+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

Stefano Cudini

unread,
May 28, 2013, 9:06:11 PM5/28/13
to leafl...@googlegroups.com
try this simple app http://labs.easyblog.it/maps/osm-tile-cacher/

I do not think that this can be considered webscraping, download only that you see and save tiles to local files..
If you see the source code can you learn how use downloaded tiles

Chris Galli

unread,
Jun 1, 2013, 1:02:19 AM6/1/13
to leafl...@googlegroups.com
I tend to agree that even though the data and usage of the layers via a map API is free, it is always frowned upon to scrape tiles from open sources. If you don't have the ability and time to dive into building your own tile set from the mentioned resources, then please be kind to the servers with grabbing the subset of tiles and levels you are after--that is to say, do it in a fashion that is timed and not aggressive. No one benefits from large scrapings of tile sets. I'm not implying that's what you're after, but just noting the somehwat unspoken protocol of how to handle caching tiles locally.

Cheers,

-Chris

Stefano Cudini

unread,
Jun 1, 2013, 10:48:42 AM6/1/13
to leafl...@googlegroups.com
This software at the level of requests behaves exactly like any browser when it displays osm maps.
The only difference is that instead of saving the tiles in the browser cache (not easier to handle) creates a cache in a local directory.
Then lightens the load on the OSM server!
Whenever I'm write a patch for increase the cache time to 7 days!
Now is in agreement with OSM policy: http://wiki.openstreetmap.org/wiki/Tile_usage_policy

regards!
Reply all
Reply to author
Forward
0 new messages