Ejemplo n.º 1
0
 private void ClearLayers()
 {
     while (Map.Layers.Count > 0)
     {
         ILayer l = Map.Layers[0];
         if (l.DataSource.IsOpen)
         {
             l.DataSource.Close();
         }
         Map.Layers.Remove(l);
         l.DataSource.Dispose();
         l.Dispose();
     }
     Map.Layers.Clear();
 }
Ejemplo n.º 2
0
 public void Remove(ILayer featureLayer)
 {
     if (_layers == null)
     {
         return;
     }
     if (_layers.Contains(featureLayer))
     {
         _layers.Remove(featureLayer);
         if (_onRemoveLayer != null)
         {
             _onRemoveLayer(this, featureLayer);
         }
         featureLayer.Dispose();
         _layerIsChanged = true;
     }
 }
Ejemplo n.º 3
0
        protected override void UpdateElement(Input oldElement, Context oldContext)
        {
            var childContext = child.Context;

            if (oldContext != Context)
            {
                if (Context.Layer != oldContext.Layer)
                {
                    layer.Dispose();
                    layer = Context.Layer.AddChild(this);
                }


                childContext = new Context(Context, Layer);
            }

            child = child.UpdateElement(Element.Child, childContext);

            if (oldElement != Element)
            {
                ElementChanged?.Invoke(this, EventArgs.Empty);
            }
        }