Thank you very much for this information. I will look at your links.
Here is my code:
int numlayer = 0;
// charge les layers
string[] m_files = new string[4] {
"gadm36_2.shp" ,
"ne_10m_rivers_lake_centerlines_scale_rank.shp",
"ne_10m_lakes.shp",
"ne_10m_populated_places.shp"
};
handelLayer = new int[m_files.Count()];
Map.RemoveAllLayers();
Map.LockWindow(tkLockMode.lmLock);
foreach (string file in m_files)
{
if (file.ToLower().EndsWith(".shp"))
{
Shapefile sf = new Shapefile();
sf.Labels.Visible = true;
if (sf.Open((m_mapspath+file).Replace("\\\\","\\"), null))
{
handelLayer[numlayer] = Map.AddLayer(sf, true);
}
else
MessageBox.Show(sf.ErrorMsg[sf.LastErrorCode]+" "+file);
}
if (handelLayer[numlayer] != -1)
{
Map.set_LayerName(handelLayer[numlayer], file);
}
numlayer++;
}
Map.LockWindow(tkLockMode.lmUnlock);
Map.set_LayerDynamicVisibility(3, true);
Map.set_LayerMinVisibleZoom(3, 7);
Map.Redraw();
Unless I am mistaken, in the last Shape file (ne_10m_populated_places.shp) there must be the names of the cities. is it necessary to process this information?