Ejemplo n.º 1
0
        public static Map InitializeMap()
        {
            Map map = new Map();


            //string url = "http://labs.metacarta.com/wms-c/tilecache.py?version=1.1.1&request=GetCapabilities&service=wms-c";
            string url = "http://dev:8080/geoserver/gwc/service/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=getcapabilities&TILED=true";
            //string url = "http://dev:8080/geoserver/ows?service=wms&version=1.3.0&request=GetCapabilities&tiled=true";
            TiledWmsLayer tiledWmsLayer = new TiledWmsLayer("Metacarta", url);
            //tiledWmsLayer.TileSetsActive.Add(tiledWmsLayer.TileSets["avalon"].Name);
            //map.Layers.Add(tiledWmsLayer);
            //map.ZoomToBox(new BoundingBox(-180.0, -90.0, 180.0, 90.0));

            //WmscRequest req;
            //ITileSource tileSource;
            TileAsyncLayer tileLayer;
            //BruTile.Web.TmsTileSource source2 = new TmsTileSource(url);

            List<ITileSource> source = WmscTileSource.TileSourceBuilder(new System.Uri(url), null);

//            foreach (ITileSource src in source)
//            {
                tileLayer = new TileAsyncLayer(source[16], "tileLayer" + source[16]);
                tileLayer.MapNewTileAvaliable += map.MapNewTileAvaliableHandler;
                map.BackgroundLayer.Add(tileLayer);
//            }
            map.ZoomToExtents();


            return map;
        }
Ejemplo n.º 2
0
        public static Map InitializeMap()
        {
            Map map = new Map();

              string url = "http://labs.metacarta.com/wms-c/tilecache.py?version=1.1.1&amp;request=GetCapabilities&amp;service=wms-c";
              TiledWmsLayer tiledWmsLayer = new TiledWmsLayer("Metacarta", url);
              tiledWmsLayer.TileSetsActive.Add(tiledWmsLayer.TileSets["basic"].Name);
              map.Layers.Add(tiledWmsLayer);
              map.ZoomToBox(new SharpMap.Geometries.BoundingBox(-180.0, -90.0, 180.0, 90.0));

              return map;
        }