0 Replies Latest reply on Feb 26, 2012 10:13 PM by elk2210

    WMS not in Map-Contents

      Hi experts,

      I've got a problem with ArcGIS for Sharepoint and the Add-WMS-Plugin from the SDK.
      The plugin ist working and the WMS-layer I want to add is displayed over my base-map. Fine.

      But the layer is not displayed (or not added) to the "Map-Contents"-section and so it's hard to work with this layer.

      I have no clue were the problem is, but I think it must be in WMSCommand.xaml.cs.
      I've done some little changes to this file, because my WMS-server does not match the name-schema from the example (not the same ending of the link) and my code looks no like this:

      using System;
      using System.Collections.Generic;
      using System.Windows;
      using System.Windows.Controls;
      using ESRI.ArcGIS.Client.Extensibility;
      using ESRI.ArcGIS.Client.Toolkit.DataSources;
      namespace WMSCommand
          public partial class WMSDialog : UserControl
              public WMSDialog()
              private WmsLayer wmsLayer;
              private void Add_Click(object sender, RoutedEventArgs e)
                  wmsLayer = new WmsLayer();
                  wmsLayer.Url = ((ComboBoxItem)this.WMSList.SelectedItem).Tag.ToString(); 
                  // Copy the ProxyHandler.ashx file to the following location on the SharePoint Server: 
                  // <Program Files>\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS
                  // Supply the Url to the proxy.  Substitute the domain of your SharePoint server.
                  wmsLayer.ProxyUrl = "http://bimsp001/_layouts/ProxyHandler.ashx";
                  // In order to get the names of the layers, it needs to call getcapabilities
                  wmsLayer.SkipGetCapabilities = false;           
                  wmsLayer.Version = "1.1.1";
                  wmsLayer.Initialized += WMSLayer_Initialized;
                  string layerName = "WMS Layer";
                  if (wmsLayer.Url.ToLower().EndsWith(""))
                      string[] splits = wmsLayer.Url.Split('/');
                      layerName = splits[splits.Length - 1];
                  wmsLayer.SetValue(MapApplication.LayerNameProperty, layerName);
              /// <summary>
              /// In the initialized event, the getcapabilities request returns the names of the layers
              /// </summary>
              private void WMSLayer_Initialized(object sender, EventArgs args)
                  List<string> layerNames = new List<string>();
                  foreach (WmsLayer.LayerInfo layerInfo in wmsLayer.LayerList)
                      if (layerInfo.Name != null)
                  wmsLayer.Layers = layerNames.ToArray(); 

      The WMS-link I want to add looks like this: http://fbinter.stadt-berlin.de/fb/wms/senstadt/fnp_2009

      I have tried to delete the if-statement and split just any URL I add, but this does not solve the problem.
      Help would be really appreciated!
      Thanks in advance!

      EDIT: I just noticed that the layer-name ist displayed in the following dialog and if I want to remove the layer. But just not in Map-Contents on the right-side of the map.