# Loading map data in online and offline mode

**URL:** https://mapwindow.discourse.group/t/loading-map-data-in-online-and-offline-mode/601
**Category:** MapWinGIS
**Created:** [May 29, 2020, 8:57am UTC](https://mapwindow.discourse.group/t/loading-map-data-in-online-and-offline-mode/601 "2020-05-29T08:57:46Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Kayumiy](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/kayumiy/32/233_2.png) [@Kayumiy](https://mapwindow.discourse.group/u/Kayumiy)
#### Post date: [May 29, 2020, 8:57am UTC](https://mapwindow.discourse.group/t/loading-map-data-in-online-and-offline-mode/601/1 "2020-05-29T08:57:46Z")

</div>

I have shapefile map data located in local drive in my PC.  
I loaded this map data by using mapwingis dll.

1. If I am online, I can zoom in and result is good resolution. See the result please:  

2. If I am offline, I can zoom in and result is bad resolution. See the result please:  

If I am loading map data from local drive, why internet network plays a role? I am not loading map data from internet. I don’t understand this. Please can you explain it?

---

<div class="post-metadata">

### Author: ![jerryfaust](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/jerryfaust/32/378_2.png) [@jerryfaust](https://mapwindow.discourse.group/u/jerryfaust)
#### Post date: [May 30, 2020, 12:35am UTC](https://mapwindow.discourse.group/t/loading-map-data-in-online-and-offline-mode/601/2 "2020-05-30T00:35:24Z")

</div>

Most of what you’re seeing is downloaded from OpenStreetMaps. That is not your data. When you disconnect from the Internet, some of the OpenStreetMaps imagery is cached and it tries to display that, but it can no longer refresh it for each zoom level.

Try turning off OpenStreetMaps so that you can see your data only.

```
axMap1.TileProvider = tkTileProvider.ProviderNone;
```

---

<div class="post-metadata">

### Author: ![Kayumiy](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/kayumiy/32/233_2.png) [@Kayumiy](https://mapwindow.discourse.group/u/Kayumiy)
#### Post date: [June 15, 2020, 12:22am UTC](https://mapwindow.discourse.group/t/loading-map-data-in-online-and-offline-mode/601/3 "2020-06-15T00:22:20Z")

</div>

I am making offline solution.

Is It possible to cached whole map into local drive of PC and use it in good resolution for every zoom level ?

---

<div class="post-metadata">

### Author: ![jerryfaust](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/jerryfaust/32/378_2.png) [@jerryfaust](https://mapwindow.discourse.group/u/jerryfaust)
#### Post date: [June 16, 2020, 7:10am UTC](https://mapwindow.discourse.group/t/loading-map-data-in-online-and-offline-mode/601/4 "2020-06-16T07:10:27Z")

</div>

Hello Kayumiy.

I don’t know the answer. I know that you can [download Open Street Maps data](https://wiki.openstreetmap.org/wiki/Downloading_data), and I know that an enhancement was made to the the library to support [tiles from the local file system](https://mapwindow.atlassian.net/projects/MWGIS/issues/MWGIS-152), but there are certainly some details to be worked out along the way. If you are able to work it out, perhaps you can post back your results.

Regards,  
Jerry.

---

<div class="post-metadata">

### Author: ![tiennguyen](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tiennguyen](https://mapwindow.discourse.group/u/tiennguyen)
#### Post date: [July 2, 2020, 2:55am UTC](https://mapwindow.discourse.group/t/loading-map-data-in-online-and-offline-mode/601/5 "2020-07-02T02:55:30Z")

</div>

hj Kayumiy. Currently, I want to display openstreetmap in offline mode like you. Have you find a solution in your problem, yet?. If you done, could you help me. thanks a lot

---

<div class="post-metadata">

### Author: ![Kayumiy](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/kayumiy/32/233_2.png) [@Kayumiy](https://mapwindow.discourse.group/u/Kayumiy)
#### Post date: [July 3, 2020, 7:47am UTC](https://mapwindow.discourse.group/t/loading-map-data-in-online-and-offline-mode/601/6 "2020-07-03T07:47:44Z")

</div>

Not yet,  
https://www.youtube.com/embed/mBu9XgrfZfM?feature=oembed&wmode=opaque&list=PLvlJ3T_X1cWVKXHniV_3jZfD2tlvf0jq4

maybe this link will help you.  
But I have not figured out yet

---

<div class="post-metadata">

### Author: ![pmeems](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/pmeems/32/9_2.png) [@pmeems](https://mapwindow.discourse.group/u/pmeems)
#### Post date: [July 24, 2020, 8:02am UTC](https://mapwindow.discourse.group/t/loading-map-data-in-online-and-offline-mode/601/7 "2020-07-24T08:02:47Z")

</div>

Here’s some more documentation about the [Tiles class](https://www.mapwindow.org/documentation/mapwingis4.9/class_tiles.html#details).

To enable cache usage:

```
axMap1.Tiles.set_UseCache(tkCacheType.Disk, true); // is on by default
axMap1.Tiles.set_UseCache(tkCacheType.RAM, true); // is on by default

```

To make MapWinGIS add newly downloaded tiles to cache:

```
axMap1.Tiles.set_DoCaching(tkCacheType.RAM, true); // is on by default
axMap1.Tiles.set_DoCaching(tkCacheType.Disk, true); // if off by default

```

At this point new SQLite database will created to store tiles if it wasn’t created so far. Default filename is mwtiles.db3. Location - the folder with application executable. To change location of disk cache use [Tiles.DiskCacheFilename](https://www.mapwindow.org/documentation/mapwingis4.9/class_tiles.html#af3ae88c3a742199b497b6ea9a08ea985) property.

```
axMap1.Tiles.DiskCacheFilename = "D:\tiles_cache.db3";

```

If no file with such name exists it will be created automatically. Only one database can be used at a time.  
For both types of cache there is built-in mechanism to limit its size, under exceeding of which the oldest tiles will be removed to give space for the more recent ones:

```
axMap1.Tiles.set_MaxCacheSize(tkCacheType.RAM, 200.0); // size in MB; 100 by default
axMap1.Tiles.set_MaxCacheSize(tkCacheType.Disk, 500.0); // size in MB; 100 by default

```

The Tiles class also has a [Prefetch()](https://www.mapwindow.org/documentation/mapwingis4.9/class_tiles.html#aea412fa92b9f23c9cb060d32b38559c4) method.

Let us know if and how you got this working.

---

<div class="post-metadata">

### Author: ![lang](https://avatars.discourse-cdn.com/v4/letter/l/0ea827/32.png) [@lang](https://mapwindow.discourse.group/u/lang)
#### Post date: [December 15, 2020, 11:24pm UTC](https://mapwindow.discourse.group/t/loading-map-data-in-online-and-offline-mode/601/8 "2020-12-15T23:24:38Z")

</div>

Kayumiy,  
When download the images from SASPlanet, how to get rid of the non-English labels from them?  
THanks!  
lang

---

<div class="post-metadata">

### Author: ![pmeems](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/pmeems/32/9_2.png) [@pmeems](https://mapwindow.discourse.group/u/pmeems)
#### Post date: [January 5, 2022, 2:48pm UTC](https://mapwindow.discourse.group/t/loading-map-data-in-online-and-offline-mode/601/9 "2022-01-05T14:48:39Z")

</div>

MapWinGIS is just showing the images as it gets them from the tiles provider.

If you need to change the content of the image you should ask the tiles provider.  
Sometimes you can add change the URL to get slightly different results.

---

<div class="post-metadata">

### Author: ![pmeems](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/pmeems/32/9_2.png) [@pmeems](https://mapwindow.discourse.group/u/pmeems)
#### Post date: [January 5, 2022, 2:48pm UTC](https://mapwindow.discourse.group/t/loading-map-data-in-online-and-offline-mode/601/10 "2022-01-05T14:48:43Z")

</div>


