Quantcast
Channel: GMap.NET - Great Maps for Windows Forms & Presentation
Viewing all articles
Browse latest Browse all 3384

New Post: GMap.Net offline (static)

$
0
0
If you can download the map tiles to your offline storage, you can use a custom provider to read the tiles from your computer.
 string MakeTileImageUrl(GPoint pos, int zoom, string language) {

            long x = pos.X;
            int num = 1 << (zoom & 31);
            long y = (long)num - pos.Y - (long)1;
            string str = string.Format(LocalFileProvider.UrlFormat, zoom, x, y);
            if (System.IO.File.Exists(str)) {
                return str;
            }
            return "maptilesofflinefolder/empty.png";
        }

        static readonly string UrlFormat = "/maptilesofflinefolder/{0}/{1}/{2}.jpg";

Viewing all articles
Browse latest Browse all 3384


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>