anonimusBird
anonimusBird

Reputation: 1

How to add city names in arcgis offline map?

I am making an offline map application using arcgis .net sdk. Here I print the map with image tile. So, I have the images of the map in PNG format. I can use the map offline by displaying it as a map with the help of arcgis WebTiledLayer. However, since everything is visual here, cities, streets, street names, etc. not shown. How can I add these to the map? How can I show it?

This is my code to print the map on the screen:

const string path= "C:\\\\map\\\\{level}\\\\{col}\\\\{row}.png";    
WebTiledLayer webLayer = new(path);    
Basemap layerBaseMap = new();    
layerBaseMap.BaseLayers.Add(webLayer);    
map = new Map(layerBaseMap);    
_mapView.Map = map;

I wonder if I can do it using featurelayer? How can I do it?

Upvotes: 0

Views: 107

Answers (1)

MakePeaceGreatAgain
MakePeaceGreatAgain

Reputation: 37115

You can add all kinds of different layers to your Map using the OperationalLayers-property. From your question it seems you have some feature-layers (e.g. streets and cities) as well as annotation-layers (streenames). You need to add these to your map:

const string path= "C:\\\\map\\\\{level}\\\\{col}\\\\{row}.png";    
WebTiledLayer webLayer = new(path);    
Basemap layerBaseMap = new();    
layerBaseMap.BaseLayers.Add(webLayer);  

map = new Map(layerBaseMap);

var citiesLayer = new FeatureLayer(new ServiceFeatureTable(myCitiesFeatureServiceUrl));
var streetNames = new AnnotationLayer(myStreetnamesServiceUrl);
map.OperationalLayers.Add(cities);
map.OperationalLayers.Add(streeNames);

_mapView.Map = map;

Be aware on the order of the Add-statements, as it will imply which layers are above and which ones are beyond. So whatever you add first, might be hidden by the last added layer, for instance.

Upvotes: 0

Related Questions