static wms-c

Oct 17, 2011 at 12:16 PM
Edited Oct 18, 2011 at 1:37 PM

hi

i have a wms server with static wms-c capacity, i seem i can acceed map image with url like www.monserver.com/tilecache/nomcarte/0/0/0/image.png.

i seach with sharpmap how i can use this map.

With open layer i use this code :

function init(){
    OpenLayers.IMAGE_RELOAD_ATTEMPTS = 10;
    OpenLayers.Util.onImageLoadErrorColor = "transparent";
 
    // Créer la map
    var options={
                numZoomLevels: 14,
                projection: new OpenLayers.Projection("EPSG:900913"),
                displayProjection: new OpenLayers.Projection("EPSG:4326"),
                units: 'm',
                resolutions:[ 156543.0339,78271.51695,39135.758475,19567.879237500,9783.939618750,
                              4891.969809375,2445.984904688,1222.992452344,611.496226172,305.748113086,
                              152.874056543,76.437028271,38.218514136,19.109257068
                           ],
                maxResolution: 156543.0339,
                maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34),
                controls: [new OpenLayers.Control.MouseDefaults()]
                };
 
    map = new OpenLayers.Map( 'map',options);
 
        var TiledExtraOptions = { format: 'image/png',
                            isBaseLayer: true,
                            visibility: true};
 
        var oLayerTuile = new OpenLayers.Layer.TileCache(
      "Carte routiere MSP",
      "http://www.monserver.com/tilecach/",
      "carte",
      TiledExtraOptions
       );
 
    /* Ajouter le layer à la map*/
    map.addLayer(oLayerTuile);
 
    /* Ajout des controls de base*/
    map.addControl(new OpenLayers.Control.Attribution());
    map.addControl(new OpenLayers.Control.PanZoomBar());
    map.addControl(new OpenLayers.Control.MousePosition());
    map.addControl(new OpenLayers.Control.LayerSwitcher());
 
    /* Cadrer sur l'étendue demandé*/
    map.zoomToExtent(new OpenLayers.Bounds(-8143094,5809805,-8053511,6070882));
 
}

There other one option it a wms-c with a cgi and this one can produce a getcapability but i not sure how to use it.
thanks
Oct 31, 2011 at 12:06 PM

i succed to use wms-c with the cgi with the version 93847 on this way

 

string url = "http://www.monserver.com/tilecache2/tilecache.cgi?SERVICE=WMS&REQUEST=GetCapabilities"; 
 

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

SharpMap.Layers.

TileLayer myTiledLayer = new SharpMap.Layers.TileLayer(source[2], url); 
myTiledLayer.SRID = mapEPSG;

myMap.BackgroundLayer.Add(myTiledLayer);