ArcGIS Runtime with Nearmap

453
2
01-29-2019 12:22 PM
shaynifroimowitz
New Contributor

I am using ArcGIS Runtime and i want to change the basemap to use Nearmap maps. What API can i use?

Thank you!

0 Kudos
2 Replies
NathanCastle1
Esri Contributor
0 Kudos
shaynifroimowitz
New Contributor

Thank you.

I have tried the 3 suggestions in order to use Nearmap as the basemap for ArcGIS Runtime, however, none of them worked. Please see example of my code below.

WMS way:

mapView = new MapView();
myMap = new Map(Basemap.CreateImagery());
overlay = new GraphicsOverlay();
mapView.GraphicsOverlays.Add(overlay);
mapView.Map = myMap;
//add WMS Layer for Nearmap map
Uri wmsUrl = new Uri(@"https://wmsus.nearmap.com/wms?REQUEST=GetCapabilities&httpauth=false&apikey=MyAPIKey");
List<String> wmsLayerNames = new List<string> { "1" };
WmsLayer myWmsLayer = new WmsLayer(wmsUrl, wmsLayerNames);
myMap.OperationalLayers.Add(myWmsLayer);

WMTS way:
mapView = new MapView();
myMap = new Map(Basemap.CreateImagery());
overlay = new GraphicsOverlay();
mapView.GraphicsOverlays.Add(overlay);
//add WMTS Layer for Nearmap map
Basemap myBasemap = myMap.Basemap;
LayerCollection myLayerCollection = myBasemap.BaseLayers;
WmtsLayer myWmtsLayer;
Uri wmtsUri = new Uri("https://us0.nearmap.com/maps/api/wmts/v1/apikey/MyAPIKey");
myWmtsLayer = new WmtsLayer(wmtsUri, "WorldTimeZones");
myLayerCollection.Add(myWmtsLayer);
mapView.Map = myMap;

WebTile way:
mapView = new MapView();
myMap = new Map(Basemap.CreateImagery());
overlay = new GraphicsOverlay();
mapView.GraphicsOverlays.Add(overlay);
//add WebTile Layer for Nearmap map
WebTiledLayer myBaseLayer = new WebTiledLayer("https://api.nearmap.com/tiles/v3/Vert/z/y/x".jpg?apikey=MyAPIKey", new List<string> { "a", "b", "c", "d" });
Basemap layerBasemap = new Basemap(myBaseLayer);
myMap = new Map(layerBasemap);
mapView.Map = myMap;

Please advise what i can do to use Nearmap.

Thank you!

0 Kudos