DeepEarth2011 Bind WMS image to Layer

Jan 13, 2011 at 6:49 AM
Edited Jan 13, 2011 at 6:50 AM

Hi Guys,

I am trying to bind a layer to a WMS custom size image (no tiles!!) I am requesting through wms.

I need to have the control over the wms calls so I am just willing to create a MVVM construction that binds the Layer to a GeoItemViewModel(?) that holds the Image Ia and when I change the Image in the viewModel, the change is automatically displayed

Can you help me with some tips on how to do it? What is the best practice?

I attach the code I use to display it but, I have the filing this is not the right way. The problem here is that the origin point of the picture is TopLeft and it doesn't pan, zoom with the rest of the layers.

Which Layer structure is the best to use?

Thanks in advance!

      DynamicLayer rasterLayer = _layer.FindName("Image") as DynamicLayer;
      Image _img = _model.CurrentImage;
      Layer.SetPosition(_img, _map.BoundingRectangle.NorthWest);

      var  _adorner = new MapItemAdorner();
      _adorner.Content = _img;

      var _vm = new GeoItemViewModel();
      _vm.Data = _img;
      _vm.Position = Layer.GetPosition(_img);

      var _cvm = new ClusterViewModel(_vm);
      _adorner.DataContext = _cvm;
      rasterLayer.Add(_cvm, _adorner);