Loading map data in online and offline mode

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?

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;
2 Likes

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 ?

Hello Kayumiy.

I don’t know the answer. I know that you can download Open Street Maps data, and I know that an enhancement was made to the the library to support tiles from the local file system, 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.

1 Like

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

1 Like

Not yet,

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

Here’s some more documentation about the Tiles class.

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 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() method.

Let us know if and how you got this working.

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

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.