Using BruTile on standalone PCs

Aug 18, 2011 at 2:40 PM

Hello every one. Can I use BruTile working with *.osm files(from http://downloads.cloudmade.com) on standalone PC(offline).

 

        const string filePath = @"D:\Temp\���������\gis_OSM\Map\";

        SharpMap.Map _globalMap;

        /// <summary>
        /// ����������� ������ osmMAP
        /// </summary>
        public osmMAP(System.Drawing.Size _mapSize)
        {
            _globalMap = new SharpMap.Map(_mapSize);
            BruTile.PreDefined.SphericalMercatorWorldSchema prSchema=new SphericalMercatorWorldSchema();
            
            var fSource = new TileSource(new FileTileProvider(new FileCache(filePath, "osm")), prSchema);

            var osmLayer = new TileLayer(new OsmTileSource(), "OSM");
            var osmFileLayer = new TileLayer(fSource, "OSM FileLayer");
            
            //_globalMap.Layers.Add(osmLayer);
            _globalMap.Layers.Add(osmFileLayer);
            _globalMap.ZoomToExtents();
        }

        public System.Drawing.Image getImage()
        {
            return _globalMap.GetMap();
        }

Using this code I can see just backcolor of SharpMap.Forms.MapImage. If I add osmLayer it works great. 

 

Coordinator
Aug 19, 2011 at 11:12 AM

hi,

As I replied in SharpMap forum, you are probably not using a tilesource. You could try SharpMap's shapefile provider.

Paul

Aug 19, 2011 at 11:15 AM

Thank you Paul. I've already read it ;)