Hi,
I'm new with all GIS, and I'm evaluating the WMS with OSM. I already download the shp for OSM and modify the GetMapConfiguratrionCore() to the following
string worldLayerFilePath = Directory.GetParent(Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory).FullName).FullName + Path.DirectorySeparatorChar + "SampleData" + Path.DirectorySeparatorChar + "adminareas_lvl06.shp";
// Create the world layer from a shapefile and add a style to it
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(worldLayerFilePath);
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
// Create a MapConfiguration and add the layer to it
MapConfiguration mapConfiguration = new MapConfiguration();
mapConfiguration.Layers.Add("boundary", worldLayer);
return mapConfiguration;
and my Page_Load()
Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"));
Map1.CurrentExtent = new RectangleShape(-131.22, 55.05, -54.03, 16.91);
Map1.MapUnit = GeographyUnit.DecimalDegree;
PointShape pointInEquator = new PointShape(double.Parse("0", CultureInfo.InvariantCulture), double.Parse("0", CultureInfo.InvariantCulture));
EllipseShape cir = new EllipseShape(pointInEquator, 100, 100, Map1.MapUnit, DistanceUnit.Mile);
cir.TranslateByOffset(double.Parse("-95.28109"), double.Parse("38.95363"));
Map1.EditOverlay.Features.Add(new Feature(cir));
WmsOverlay wmsOverlay = new WmsOverlay("WMS Overlay");
wmsOverlay.Parameters.Add("LAYERS", "Display A Simple Map");
wmsOverlay.Parameters.Add("STYLES", "DEFAULT");
wmsOverlay.ServerUris.Add(new Uri("localhost:62626/WmsHandler.axd"));
Map1.CustomOverlays.Add(wmsOverlay);
When I run the projects, I got pink tiles. Not sure what is the problem or something that I missed.
Thanks
VQV