i want to add multiple markers from server side and i want to delte those multiple markers at atime.how to add and delete multiple markers from server side
How to add multiple markers
Hi rajanikanth,
You can find information about Markers in the Markers section of our Map Suite Web Edition Sample applications.
Specifically I would review the AddSimpleMarkers and the AddAnInMemoryMarkerOverlay samples.
With the SimpleMarkerOverlay you can easily add and remove Markers by using the .Add() and .Remove() methods.
The InMemoryMarkerOverlay does this a bit differently with the .AddFeature() and DeleteFeature() methods. Note that in the AddAnInMemoryMarkerOverlay that you need to use our Transaction system as we are accessing the FeatureSource of the InMemoryMarkerOverlay. You can see this in action in the following code pulled from the sample application:
private void Form_Load(object sender, EventArgs e)
{
winformsMap1.MapUnit = GeographyUnit.DecimalDegree;
winformsMap1.CurrentExtent = new RectangleShape(-155.733, 95.60, 104.42, -81.9);
WorldMapKitWmsDesktopOverlay worldMapKitOverlay = new WorldMapKitWmsDesktopOverlay();
winformsMap1.Overlays.Add(worldMapKitOverlay);
InMemoryMarkerOverlay markerOverlay = new InMemoryMarkerOverlay();
markerOverlay.MapControl = winformsMap1;
markerOverlay.Columns.Add(new FeatureSourceColumn("Name"));
markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultPointMarkerStyle.Image = Properties.Resources.AQUA;
markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultPointMarkerStyle.Width = 20;
markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultPointMarkerStyle.Height = 34;
markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultPointMarkerStyle.YOffset = -17;
markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultPointMarkerStyle.ToolTipText = "This is [#Name#].";
markerOverlay.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
winformsMap1.Overlays.Add("MarkerOverlay", markerOverlay);
Feature newFeature = new Feature(-95.2806, 38.9554);
newFeature.ColumnValues.Add("Name", "Lawrence");
markerOverlay.FeatureSource.BeginTransaction();
markerOverlay.FeatureSource.AddFeature(newFeature);
markerOverlay.FeatureSource.CommitTransaction();
winformsMap1.Refresh();
}
can u show me how to add multiple markers
like marker1
marker2
marker3
like this
and i want to delete alla markers at a time
Hi Rajanikanth,
You will need to take a look at the sample applications I mentioned above for inspiration. These samples are installed on your computer during the installation of the Map Suite Web Evaluation Edition at:
Start - All Programs - ThinkGeo - Map Suite Web Evaluation Edition - VS 2010 Samples - C# or VB Samples.
You might also check out our ThinkGeo Wiki (wiki.thinkgeo.com) that has API Documention, Frequently Asked Questions, and even more Code Samples. If after you look through these resources you are unable to add multiple markers please feel free to request assistance through this forum.