I am trying to get a Bing Maps overlay working. Below is my code. When it runs I see it creates BingMapsMetadata.xml in my C:\Temp folder but the code throws an error of "Parameter is not valid". The example out there are very lacking when it comes to the overlays. What am I missing here?
mapCtrl.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFitmapCtrl.MapResizeMode = MapResizeMode.PreserveScaleAndCenter
mapCtrl.MapUnit = GeographyUnit.DecimalDegreemapCtrl.BackgroundOverlay.BackgroundBrush =NewGeoSolidBrush(GeoColor.GeographicColors.ShallowOcean)mapCtrl.CurrentExtent =NewRectangleShape(-75.412903, 41.409776, -73.979187, 38.826871)
DimapplicationIDAsString="123456789"DimcacheDirectoryAsString="C:\Temp"DimbingMapsLayerAsNewBingMapsLayer(applicationID, BingMapsMapType.Road, cacheDirectory)
DimstaticOverlayAsNewLayerOverlay()staticOverlay.Layers.Add("WorldLayer", bingMapsLayer)mapCtrl.Overlays.Add(staticOverlay)
simpleMarkerOverlay =NewSimpleMarkerOverlay()simpleMarkerOverlay.MapControl = mapCtrl
simpleMarkerOverlay.DragMode = MarkerDragMode.Drag
mapCtrl.Overlays.Add("SimpleMarker", simpleMarkerOverlay)
mapCtrl.Refresh()