Hi,
I have few problems in Zoom in and Zoom out using mouse wheel and mouse click event. I am using mouse wheel and mouse click for zoom in and zoom out it will take time for zoom in and zoom out. It take very slow. Not able to zoom fastly. Please guide me for fast zoom in desktop edition. I attached My Code given below.
private void Form1_Load(object sender, EventArgs e)
{
City1.SelectedItem = "--Select--";
BindStreet();
BindPOI();
lbllatitude.Text = string.Empty;
lbllongitude.Text = string.Empty;
winformsMap2.MapUnit = GeographyUnit.DecimalDegree;
winformsMap2.MapClick += new EventHandler<MapClickWinformsMapEventArgs>(winformsMap2_MapClick);
winformsMap2.MouseWheel += new System.Windows.Forms.MouseEventHandler(winformsMap2_MouseWheel);
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Desktop Evaluation Edition 5.0\Samples\SampleData\Data\Countries02.shp");
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
ShapeFileFeatureLayer capitalLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Desktop Evaluation Edition 5.0\Samples\SampleData\Data\WorldCapitals.shp");
capitalLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.CreateSimpleCircleStyle(GeoColor.StandardColors.White, 7, GeoColor.StandardColors.Brown);
capitalLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level05;
capitalLayer.ZoomLevelSet.ZoomLevel06.DefaultPointStyle = PointStyles.Capital3;
capitalLayer.ZoomLevelSet.ZoomLevel06.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
ShapeFileFeatureLayer StreetsLabelLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Desktop Evaluation Edition 5.0\Samples\SampleData\Data\WorldCapitals.shp");
StreetsLabelLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(TextStyles.LocalRoad1("CITY_NAME"));
StreetsLabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
StreetsLabelLayer.ZoomLevelSet.ZoomLevel06.DefaultTextStyle = TextStyles.Capital3("CITY_NAME");
StreetsLabelLayer.ZoomLevelSet.ZoomLevel06.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
StreetsLabelLayer.DrawingMarginPercentage = 50;
ShapeFileFeatureLayer POILabelLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Desktop Evaluation Edition 5.0\Samples\SampleData\Data\RIYADH_POI.shp");
POILabelLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.CreateSimpleCircleStyle(GeoColor.StandardColors.White, 7, GeoColor.StandardColors.Red);
POILabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level05;
POILabelLayer.ZoomLevelSet.ZoomLevel06.DefaultPointStyle = PointStyles.City3;
POILabelLayer.ZoomLevelSet.ZoomLevel06.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
ShapeFileFeatureLayer POILabelNameLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Desktop Evaluation Edition 5.0\Samples\SampleData\Data\RIYADH_POI.shp");
POILabelNameLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(TextStyles.LocalRoad1("Name_Lang2"));
POILabelNameLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
POILabelNameLayer.ZoomLevelSet.ZoomLevel06.DefaultTextStyle = TextStyles.Capital3("Name_Lang2");
POILabelNameLayer.ZoomLevelSet.ZoomLevel06.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
POILabelNameLayer.DrawingMarginPercentage = 50;
ShapeFileFeatureLayer HwyLabelLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Desktop Evaluation Edition 5.0\Samples\SampleData\Data\MajHwys.shp");
HwyLabelLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(TextStyles.Highway2("Name_Lang2"));
HwyLabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
HwyLabelLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(LineStyles.Highway1);
ShapeFileFeatureLayer SwyLabelLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Desktop Evaluation Edition 5.0\Samples\SampleData\Data\SecHwys.shp");
SwyLabelLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(TextStyles.Highway2("Name_Lang2"));
SwyLabelLayer.ZoomLevelSet.ZoomLevel15.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
SwyLabelLayer.ZoomLevelSet.ZoomLevel15.CustomStyles.Add(LineStyles.Highway1);
LayerOverlay staticOverlay = new LayerOverlay();
staticOverlay.Layers.Add("worldLayer", worldLayer);
staticOverlay.Layers.Add("capitalLayer", capitalLayer);
staticOverlay.Layers.Add("StreetsLabelLayer", StreetsLabelLayer);
staticOverlay.Layers.Add("POILabelLayer", POILabelLayer);
staticOverlay.Layers.Add("POILabelNameLayer", POILabelNameLayer);
staticOverlay.Layers.Add("HwyLabelLayer", HwyLabelLayer);
staticOverlay.Layers.Add("SwyLabelLayer", SwyLabelLayer);
winformsMap2.Overlays.Add(staticOverlay);
// Xmin , Ymax ,Xmax,Ymin
winformsMap2.CurrentExtent = new RectangleShape(42.2883299998541, 27.2102700001565, 47.5584099995663, 18.8629799998474);
winformsMap2.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);
MarkerLayer markerLayer = new MarkerLayer();
staticOverlay.Layers.Add("MarkerLayer", markerLayer);
SimpleMarkerOverlay markerOverlay = new SimpleMarkerOverlay();
markerOverlay.Markers.Add(marker);
winformsMap2.ContextMenuStrip = contextMenuStrip1;
markerOverlay.MapControl = winformsMap2;
winformsMap2.Overlays.Add("MarkerOverlay", markerOverlay);
winformsMap2.MaximumScale = winformsMap2.CurrentScale;
winformsMap2.Refresh();
}
Regards Yakub