I am creating an application that uses Virtual Earth with a powerline shapefile on top. What I am finding is that after panning or zooming the map that sometimes the shapefile will not line up with the Virtual Earth Map. Another issue is that durning a ZoomIn or ZoomOut the shapefile will disappear.
Here is a screenshot showing the shapefile lining up properly:
Here is an example of the misalignement after panning:
Here is the code I am using to create this map:
protected void Page_Load(object sender, EventArgs e)
{
Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#B3C6D4"));
Map1.MapUnit = GeographyUnit.Meter;
Map1.MapTools.OverlaySwitcher.Enabled = true;
Map1.MapTools.MouseCoordinate.Enabled = true;
VirtualEarthOverlay ve = new VirtualEarthOverlay("VirtualEarth Map");
Uri VirtualEarthURI = new Uri("dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2");
ve.JavaScriptLibraryUri = VirtualEarthURI;
ve.VirtualEarthMapType = VirtualEarthMapType.Road;
ShapeFileFeatureLayer Powerline = new ShapeFileFeatureLayer(@"C:\Projects\Powerline.shp");
Powerline.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.Blue, 5, true);
Powerline.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
Proj4Projection proj4 = new Proj4Projection();
proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326);
proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();
Powerline.FeatureSource.Projection = proj4;
LayerOverlay shapeOverlay = new LayerOverlay("Shape Overlay", false, TileType.SingleTile);
shapeOverlay.Layers.Add(Powerline);
shapeOverlay.TransitionEffect = TransitionEffect.None;
Map1.CustomOverlays.Add(ve);
Map1.CustomOverlays.Add(shapeOverlay);
Powerline.Open();
Map1.CurrentExtent = Powerline.GetBoundingBox();
Powerline.Close();
}