ThinkGeo.com    |     Documentation    |     Premium Support

Migration TiledWmsLayer to v12

How can I migrate this to v12?

            var layer = new TiledWmsLayer();
            layer.ServerUris.Add(new Uri(Settings.CustomUri));
            layer.ActiveLayerNames.Add("osm");
            layer.SendingWebRequest += Backlayer_SendingWebRequest;
            if (!string.IsNullOrEmpty(Settings.MapKey) && !string.IsNullOrEmpty(Settings.GoogleClientId))
            {
                layer.ClientId = Settings.GoogleClientId;
                layer.PrivateKey = Settings.MapKey;
            }

        if (string.IsNullOrEmpty(Settings.WebProxy)) return new LayerOverlay(new BindingList<Layer> { layer });

        layer.WebProxy = CreateWebProxy() != null ? CreateWebProxy() : layer.WebProxy;
        layer.SendingWebRequest += LayerSendingWebRequest;
        return new LayerOverlay(new BindingList<Layer> { layer });

Thanks Mahdi,
What current version you are using. Base on the code you attached. I think you are try to use the google map.

Here is the way to use google map overlay in V12. You need provide the Apikey and SigningSecret.

 GoogleMapsOverlay googleMapOverlay = new GoogleMapsOverlay("YourApiKey", "YourSigningSecret");
            googleMapOverlay.IsVisible = false;
            map.Overlays.Add("Google Maps", googleMapOverlay);

Here is the way to use google map

  GoogleMapsLayer googleMapsLayer = new GoogleMapsLayer();
            googleMapsLayer.ApiKey = "YourApiKey";
            googleMapsLayer.UriSigningSecret = "YourSigningSecret";
            googleMapsLayer.MapType = GoogleMapsMapType.RoadMap;
            LayerOverlay layerOverlay = new LayerOverlay();
            layerOverlay.Layers.Add(googleMapsLayer);
            map.Overlays.Add(layerOverlay);

You can find more wpf sample at

Desktop Sample:

WMSLayer sample:

Thanks

Frank

I know how to use GoogleMap or bing, TiledWmsLayer is our custom WmsLayer which we pass CustomUri.
I used v10.6.

I can refer to Use Custom WMS feeds
I need this solution for v12.

Thanks Mahdi,
I looked into it. You could try with WmsRasterLayer or WmtsLayer. Here is the code for V12.

 private void LoadCustomeWMS()
        {
            WmsRasterLayer layer = new WmsRasterLayer(new System.Uri("http://irs.gis-lab.info"));

            // WmtsLayer layer = new WmtsLayer(new Collection<System.Uri> { new System.Uri("http://irs.gis-lab.info") });
            layer.SendingWebRequest += Backlayer_SendingWebRequest;

            var overlay = new LayerOverlay(new BindingList<Layer> { layer });
            
            WpfMap.Overlays.Insert(0, "wms", overlay);

        }

Thanks

Frank