public override void OnClick() { try { const string url = "https://bertt.github.io/wmts/capabilities/thunderforest.xml"; var wmtsLayer = WmtsLayerHelper.GetWmtsLayer(url, "OpenCycleMap", "thunderforest-opencyclemap"); if (wmtsLayer != null) { var mxdoc = (IMxDocument)_application.Document; var map = mxdoc.FocusMap; ((IMapLayers)map).InsertLayer(wmtsLayer, true, 0); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public override void OnClick() { try { const string url = "https://bertt.github.io/wmts/capabilities/osm.xml"; var wmtsLayer = WmtsLayerHelper.GetWmtsLayer(url, "OpenStreetMap Black and White", "osm-blackwhite"); if (wmtsLayer != null) { var mxdoc = (IMxDocument)_application.Document; var map = mxdoc.FocusMap; ((IMapLayers)map).InsertLayer(wmtsLayer, true, 0); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }