Hi,
I’m having issues setting the zoom scale for a zoom level set. We have points that can be a metre apart, so need to set a high level of zoom for the layers. The code below shows how we are currently doing this, but it doesnt seem to work (the same code, does work on WPF)
var thinkGeoMap =
new
Map(
“Map1”
, 800, 550) { MapUnit = GeographyUnit.Meter };
thinkGeoMap.MapBackground =
new
BackgroundLayer(
new
GeoSolidBrush(GeoColor.FromHtml(
"#E5E3DF"
)));
// *** this doesnt seem to do anything ****
thinkGeoMap.ZoomLevelSet.ZoomLevel20.Scale = thinkGeoMap.ZoomLevelSet.ZoomLevel20.Scale / 17.5;
thinkGeoMap.ZoomLevelSet.ZoomLevel19.Scale = thinkGeoMap.ZoomLevelSet.ZoomLevel19.Scale / 17.5;
thinkGeoMap.ZoomLevelSet.ZoomLevel18.Scale = thinkGeoMap.ZoomLevelSet.ZoomLevel18.Scale / 17.5;
thinkGeoMap.ZoomLevelSet.ZoomLevel17.Scale = thinkGeoMap.ZoomLevelSet.ZoomLevel17.Scale / 17;
var layerOverlay =
new
LayerOverlay(
“overlay”
);
thinkGeoMap.CustomOverlays.Add(layerOverlay);
// create point layer
var pointLayer =
new
InMemoryFeatureLayer();
layerOverlay.Layers.Add(pointLayer);
var markerStyle = PointStyles.CreateSimplePointStyle(PointSymbolType.Circle, GeoColor.GetRandomGeoColor(RandomColorType.Pastel), GeoColor.GeographicColors.Grass, 10);
pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = markerStyle;
pointLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
pointLayer.FeatureSource.Open();
pointLayer.FeatureSource.BeginTransaction();
PointShape pointShape1 =
new
PointShape(1000, 2000);
var pointFeature1 =
new
Feature(pointShape1);
pointLayer.FeatureSource.AddFeature(pointFeature1);
PointShape pointShape2 =
new
PointShape(1001, 2000);
var pointFeature2 =
new
Feature(pointShape2);
pointLayer.FeatureSource.AddFeature(pointFeature2);
pointLayer.FeatureSource.CommitTransaction();
var boundingbox = pointLayer.GetBoundingBox();
pointLayer.FeatureSource.Close();
thinkGeoMap.CurrentExtent = boundingbox;
var map = Html.ThinkGeo().Map(thinkGeoMap);
map.Render();
Can someone please advise on how this should work? We are using 7.0.0.149
Thanks,
Steve