コード例 #1
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////

        public static AgsLayer CreateLayer(AgsServer server, MapLayer layer)
        {
            if (layer.MapServiceInfo.Type == null)
            {
                throw new SettingsException((string)App.Current.FindResource("InvalidMapLayerType"));
            }

            AgsLayer agsLayer = null;

            if (layer.MapServiceInfo.Type.Equals(DYNAMIC_SERVICE,
                                                 StringComparison.OrdinalIgnoreCase))
            {
                agsLayer = new AgsDynamicLayer(server, layer);
            }
            else if (layer.MapServiceInfo.Type.Equals(CACHED_SERVICE,
                                                      StringComparison.OrdinalIgnoreCase))
            {
                agsLayer = new AgsCachedLayer(server, layer);
            }
            else
            {
                throw new SettingsException((string)App.Current.FindResource("UnknownMapLayerType"));
            }

            return(agsLayer);
        }
コード例 #2
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////
        public static AgsLayer CreateLayer(AgsServer server, MapLayer layer)
        {
            if (layer.MapServiceInfo.Type == null)
                throw new SettingsException((string)App.Current.FindResource("InvalidMapLayerType"));

            AgsLayer agsLayer = null;
            if (layer.MapServiceInfo.Type.Equals(DYNAMIC_SERVICE,
                StringComparison.OrdinalIgnoreCase))
            {
                agsLayer = new AgsDynamicLayer(server, layer);
            }
            else if (layer.MapServiceInfo.Type.Equals(CACHED_SERVICE,
                StringComparison.OrdinalIgnoreCase))
            {
                agsLayer = new AgsCachedLayer(server, layer);
            }
            else
                throw new SettingsException((string)App.Current.FindResource("UnknownMapLayerType"));

            return agsLayer;
        }