I have the same with bing, and also with openstreetmap in MI10.5
it seems to depend on the width (not height) of the mapwindow
at certain discrete width's (around 384 pts or 820 pts for example) the image suddenly resets to a very sharp and very OK display,
while resizing the window, you see it degrade, until it suddenly jumps to ok again
wonder if it depends on screen resolution settings, and why these strange numbers (not multiples of 256 tile size) and not dependent on height (any height is ok)
First, you need to use BruTile 0.7.4 for the Bing maps to work correctly (there was a bug in the 0.7.3).
0.7.4 is newly released on NuGet
The you can do like this..
SharpMap.Layers.VectorLayer vLay = new SharpMap.Layers.VectorLayer("Name of layer", provider);
ICoordinateTransformationFactory ctFact = new ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory();
vLay.CoordinateTransformation =
ctFact.CreateFromCoordinateSystems(getGDA94(csFact), GetEPSG900913(csFact));
vLay.ReverseCoordinateTransformation =
ctFact.CreateFromCoordinateSystems(GetEPSG900913(csFact), getGDA94(csFact));
And the helper methods
ICoordinateSystem getGDA94(ICoordinateSystemFactory csFact)
{
return csFact.CreateFromWkt("PROJCS[\"GDA94 / MGA zone 56\",GEOGCS[\"GDA94\",DATUM[\"D_GDA_1994\",SPHEROID[\"GRS_1980\",6378137,298.257222101]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",153],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",10000000],UNIT[\"Meter\",1]]");
}
private IProjectedCoordinateSystem GetEPSG900913(ICoordinateSystemFactory csFact)
{
List<GeoAPI.CoordinateSystems.ProjectionParameter> parameters = new List<GeoAPI.CoordinateSystems.ProjectionParameter>();
parameters.Add(new GeoAPI.CoordinateSystems.ProjectionParameter("semi_major", 6378137.0));
parameters.Add(new GeoAPI.CoordinateSystems.ProjectionParameter("semi_minor", 6378137.0));
parameters.Add(new GeoAPI.CoordinateSystems.ProjectionParameter("latitude_of_origin", 0.0));
parameters.Add(new GeoAPI.CoordinateSystems.ProjectionParameter("central_meridian", 0.0));
parameters.Add(new GeoAPI.CoordinateSystems.ProjectionParameter("scale_factor", 1.0));
parameters.Add(new GeoAPI.CoordinateSystems.ProjectionParameter("false_easting", 0.0));
parameters.Add(new GeoAPI.CoordinateSystems.ProjectionParameter("false_northing", 0.0));
GeoAPI.CoordinateSystems.IProjection projection = csFact.CreateProjection("Google Mercator", "mercator_1sp", parameters);
GeoAPI.CoordinateSystems.IGeographicCoordinateSystem wgs84 = csFact.CreateGeographicCoordinateSystem(
"WGS 84", ProjNet.CoordinateSystems.AngularUnit.Degrees,
ProjNet.CoordinateSystems.HorizontalDatum.WGS84,
ProjNet.CoordinateSystems.PrimeMeridian.Greenwich,
new GeoAPI.CoordinateSystems.AxisInfo("north", GeoAPI.CoordinateSystems.AxisOrientationEnum.North),
new GeoAPI.CoordinateSystems.AxisInfo("east", GeoAPI.CoordinateSystems.AxisOrientationEnum.East)
);
GeoAPI.CoordinateSystems.IProjectedCoordinateSystem epsg900913 = csFact.CreateProjectedCoordinateSystem("Google Mercator", wgs84, projection,
ProjNet.CoordinateSystems.LinearUnit.Metre, new GeoAPI.CoordinateSystems.AxisInfo("East", GeoAPI.CoordinateSystems.AxisOrientationEnum.East),
new GeoAPI.CoordinateSystems.AxisInfo("North", GeoAPI.CoordinateSystems.AxisOrientationEnum.North)
);
return epsg900913;
}
Best Answer
You've been able to do this for ages. In 10.5, you can add bing maps via a one click operation.
Options>Toolbars>Web Services
Quote from the user guide:
Server-Side Authentication for WMS and WFS: You can access WFS and WMS servers that require basic authentication using the built-in standard mechanism for internet servers. To connect to a WFS or WMS server that requires authentication, complete the Connect dialog box that displays.
10 user guide
Tips and tricks WMS