Thank you I will look at it. Before I tried this method and it works this is code line:
private void ShowPoint()
{
try
{
//chargement de la carte
RectangleShape imgSize = new RectangleShape(0, 300, 300, 0);
GdiPlusRasterLayer imgCalque = new GdiPlusRasterLayer(@“C:\Yamba\Dundas\Dundas\Dundas\ci1.jpg”,imgSize);
//ajout des points
InMemoryFeatureLayer pointCalque = new InMemoryFeatureLayer();
pointCalque.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.Capital1;//new PointStyle(PointSymbolType.Circle,new GeoSolidBrush(GeoColor.StandardColors.Pink),10);
pointCalque.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
//ajout des libelle
InMemoryFeatureLayer libCalque = new InMemoryFeatureLayer();
libCalque.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = new TextStyle(“designation”, new GeoFont(“Arial”, 10, DrawingFontStyles.Italic), new GeoSolidBrush(GeoColor.StandardColors.Red));
libCalque.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
libCalque.Open();
libCalque.Columns.Add(new FeatureSourceColumn(“designation”));
//ajout des population
InMemoryFeatureLayer popCalque = new InMemoryFeatureLayer();
popCalque.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = new TextStyle(“population”, new GeoFont(“Arial”, 10, DrawingFontStyles.Italic), new GeoSolidBrush(GeoColor.StandardColors.Green));
popCalque.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
popCalque.Open();
popCalque.Columns.Add(new FeatureSourceColumn(“population”));
//ajout des superficie
InMemoryFeatureLayer supCalque = new InMemoryFeatureLayer();
supCalque.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = new TextStyle(“superficie”, new GeoFont(“Arial”, 10, DrawingFontStyles.Italic), new GeoSolidBrush(GeoColor.StandardColors.Blue));
supCalque.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
supCalque.Open();
supCalque.Columns.Add(new FeatureSourceColumn(“superficie”));
foreach (DataRow row in source.VILLE)
{
//les points a placer
PointShape pointXY = new PointShape(double.Parse(row[“xcord”].ToString()),double.Parse(row[“ycord”].ToString()));
pointCalque.InternalFeatures.Add(row[“idville”].ToString(), new Feature(pointXY));
//libelle des points placés
PointShape pointXYLib = new PointShape(double.Parse(row[“xcord”].ToString())+4, double.Parse(row[“ycord”].ToString())+4);
Feature libFeature = new Feature(pointXYLib);
libFeature.ColumnValues.Add(“designation”, row[“designation”].ToString());
libCalque.InternalFeatures.Add(row[“idville”].ToString(), libFeature);
//libelle des population
PointShape pointXYPop = new PointShape(double.Parse(row[“xcord”].ToString())+4, double.Parse(row[“ycord”].ToString())-4);
Feature popFeature = new Feature(pointXYPop);
popFeature.ColumnValues.Add(“population”, row[“population”].ToString());
popCalque.InternalFeatures.Add(row[“idville”].ToString(), popFeature);
//libelle des superficie
PointShape pointXYSup = new PointShape(double.Parse(row[“xcord”].ToString()) + 4, double.Parse(row[“ycord”].ToString()) - 12);
Feature supFeature = new Feature(pointXYSup);
supFeature.ColumnValues.Add(“superficie”, row[“superficie”].ToString());
supCalque.InternalFeatures.Add(row[“idville”].ToString() + “sup”, supFeature);
}
libCalque.Close();//fermeture du calque libelle
popCalque.Close();//fermeture du calque population
supCalque.Close();//fermeture du calque superficie
//ajout des calques
LayerOverlay coucheImg = new LayerOverlay();
coucheImg.Layers.Add(“imgCalque”, imgCalque);//couche de la carte
LayerOverlay couchePoint = new LayerOverlay();
couchePoint.Layers.Add(“pointCalque”, pointCalque);//couche des villes
LayerOverlay coucheLib = new LayerOverlay();
coucheLib.Layers.Add(“libCalque”, libCalque);//couche des libelles
LayerOverlay couchePop = new LayerOverlay();
couchePop.Layers.Add(“popCalque”, popCalque);//couche des populations
LayerOverlay coucheSup = new LayerOverlay();
coucheSup.Layers.Add(“supCalque”, supCalque);//couche des superficie
//attribuer la couche au control map
mapFenetre.Overlays.Add(“coucheImg”, coucheImg);//carte
mapFenetre.Overlays.Add(“couchePoint”,couchePoint);//les villes
mapFenetre.Overlays.Add(“coucheLib”,coucheLib);//les libelles des ville
mapFenetre.Overlays.Add(“couchePop”,couchePop);//la population des villes
mapFenetre.Overlays.Add(“coucheSup”,coucheSup);//la superficie des villes
mapFenetre.MapUnit = GeographyUnit.DecimalDegree;
mapFenetre.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.Grass);
mapFenetre.CurrentExtent = new RectangleShape(0, 300, 300, 0);
mapFenetre.Refresh();
}
catch (Exception mes)
{
MessageBox.Show(mes.Message);
}
}
I don’t know if it’s the good way but it works; Tell me something about it please.
Now I want to do another thing, it is to give the possibilite to the user to change the xcord and ycord of the point by clicking on the map. I give explaining :
The user have a combobox that contains the list of the town and a button edit. if he click on the button, all the points and labels must disappear only the point that matches the selected town in the combobox and if he clicks on the map the point take the new coordonate. if he click on the button show all, all the points and label must appear
Thank you