I am using ArcObjects in ArcMap to select a Bing aerial layer in the Table of Contents of ArcMap. I want to find out information about the service, such as the service name and URL. But I am having trouble figuring out what interface the Bing aerial service implements. Here is what I have so far:
pLayer <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>ILayer<SPAN class="punctuation token">)</SPAN>mxDoc<SPAN class="punctuation token">.</SPAN>SelectedItem<SPAN class="punctuation token">;</SPAN> <SPAN class="comment token">// Get the selected layer from the ArcMap TOC</SPAN>
IBasemapLayer bmLayer <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>IBasemapLayer<SPAN class="punctuation token">)</SPAN>pLayer<SPAN class="punctuation token">;</SPAN>
ICompositeLayer bmCompositeLayer <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>ICompositeLayer<SPAN class="punctuation token">)</SPAN>bmLayer<SPAN class="punctuation token">;</SPAN>
IBasemapSubLayer bmSubLayer <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>IBasemapSubLayer<SPAN class="punctuation token">)</SPAN>bmCompositeLayer<SPAN class="punctuation token">.</SPAN><SPAN class="token function">get_Layer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
ILayer innerLayer <SPAN class="operator token">=</SPAN> bmSubLayer<SPAN class="punctuation token">.</SPAN>Layer<SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
But once I get to the actual inner layer of the Bing aerial service, I can't figure out what other interface this implements that might have information such as the URL or service name. So I basically have two questions: 1. What interface does the Bing aerial service implement that might provide useful information about that service, and 2. Is there an easier way of figuring out what interfaces a layer implements rather than a bunch of "If" statements asking: Is it this interface? No. Is it this? No. Is it this? No. It was a real guessing game just getting the few lines of code above. Thanks.