It could be that the area you are zoomed into does not have any data available. Could you provide us the BoundingBox or the CurrentExtent of the map when you are zoomed into that area?
I think the problem comes from the CurrentExtent used for the map control. Just as shown in the code, the GeographyUnit for BingMapsLayer should be "Meter", which means all the coordinates should be set in "Meter", including the currentExtent of the map, please use the code as following to do the conversion:
Thank You!! I think I’m almost there (I have a Map)… But I’m also placing Markers and Polygons on the map so how do I “convert” their Latitude,Longitude, etc. values.
For example, when I place a Marker on the map I use the following code:
PointShape point = new PointShape(Longitude, Latitude); Marker marker = new Marker(point); Markers.Add(marker);
And Polygons:
PolygonShape polyShape = new PolygonShape(wkt); //WellKnownText feature = polyShape.GetFeature(); InternalFeatures.Add(feature);
I guess you can try InMemoryFeatureSource or ShapeFileFeatureSource, which allows us to apply a projection to it and do the projection conversion automatically. Here are some hints:
1. If you are using the SimpleMarkerOverlay or InMemoryMarkerOverlay, I guess you can create a InMemoryFeatureSource with an instance of the projection I mentioned in last post, and then put all the original coordinates into it. Just like the code as following:
// Do the geographicUnit conversion using FeatureSource and Proj4Projection InMemoryFeatureSource markerFeatureSource = new InMemoryFeatureSource(new List<FeatureSourceColumn>() { }); Proj4Projection proj4 = new Proj4Projection(); proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); markerFeatureSource.Projection = proj4; // Add the orignal points markerFeatureSource.InternalFeatures.Add(new Feature(-95.2806, 38.9554));
// Make the InMemoryFeatureSource do the conversion automatically markerFeatureSource.Open(); // just display the markers inside current bbox Collection<Feature> features = markerFeatureSource.GetFeaturesInsideBoundingBox(winformsMap1.CurrentExtent, ReturningColumnsType.AllColumns); foreach (var feature in features) { markerOverlay.FeatureSource.BeginTransaction(); markerOverlay.FeatureSource.AddFeature(feature); markerOverlay.FeatureSource.CommitTransaction(); }
2. when you are displaying the polygons, if the polygons are read from a datasource, such as SQL Server, Oracle, Shapefile etc, you can create the corresponding FeatureSource with the specified projection shown in #1, otherwise, please create the InMemoryFeatureSource in the way shown in #1.