Hi,
We have an issue with the mapping.
When map loads it has a lot of features in it (one for every county) and basically it looks like this:
But the problem is that after zooming after ‘redrawLayer’ is called some features sometimes disappear (image below).
The most important thing is that it happens only for Google Overlay so I think it may have something to do with projection settings.
Preparing overlay:
//google base overlay
var google = new GoogleOverlay("Google")
{
GoogleMapType = GoogleMapType.Normal,
JavaScriptLibraryUri =
new Uri(
"https://maps.googleapis.com/maps/api/js?key=key&callback=initMap"),
IsBaseOverlay = true
};
And here’s how layer is configured with projection:
var layer = new MultipleShapeFileFeatureLayer(Directory
.GetFiles(layerToAdd.ShapefileFolder)
.Where(x => x.EndsWith(".shp")).ToList());
//configure style (border colors) for 1-20 zoom levels
layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle =
AreaStyles.CreateSimpleAreaStyle(layerToAdd.FillColor, layerToAdd.BorderColor, 1);
layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
var overlay = new LayerOverlay(layerToAdd.Overlay)
{
IsBaseOverlay = false,
TileType = TileType.SingleTile,
ServerCache = new ServerCache(layerToAdd.ShapefileFolder + "\\cache"),
};
if (baseOverlay == BaseOverlay.GoogleMaps)
{
var proj4 = new Proj4Projection
{
ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(),
InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326)
};
layer.FeatureSource.Projection = proj4;
}
overlay.Layers.Add(layer);
map.CustomOverlays.Add(overlay);
Any help is greatly appreciated.