예제 #1
0
파일: Map.cs 프로젝트: kochizufan/OsmSharp
        /// <summary>
        /// Removes the given layer.
        /// </summary>
        /// <param name="layer"></param>
        public bool RemoveLayer(Layer layer)
        {
            lock (_layers)
            {
                if (!_layers.Remove(layer))
                {
                    return false;
                }
            }
            layer.LayerChanged -= new LayerChanged(layer_LayerChanged); // remove event handler.

            // map has obviously changed here!
            if (this.MapChanged != null) { this.MapChanged(); }

            return true;
        }
예제 #2
0
파일: Map.cs 프로젝트: kochizufan/OsmSharp
 /// <summary>
 /// Called when a layer changed.
 /// </summary>
 /// <param name="sender"></param>
 void layer_LayerChanged(Layer sender)
 {
     if (this.MapChanged != null) { this.MapChanged(); }
 }
예제 #3
0
파일: Map.cs 프로젝트: kochizufan/OsmSharp
        /// <summary>
        /// Adds a layer on top of the existing layers.
        /// </summary>
        /// <param name="layer"></param>
        public void AddLayer(Layer layer)
        {
            lock (_layers)
            {
                layer.LayerChanged += new LayerChanged(layer_LayerChanged);
                _layers.Add(layer);
            }

            // map has obviously changed here!
            if (this.MapChanged != null) { this.MapChanged(); }
        }
예제 #4
0
파일: Map.cs 프로젝트: kochizufan/OsmSharp
        /// <summary>
        /// Inserts a layer.
        /// </summary>
        /// <param name="idx"></param>
        /// <param name="layer"></param>
        public void InsertLayer(int idx, Layer layer)
        {
            lock (_layers)
            {
                layer.LayerChanged += new LayerChanged(layer_LayerChanged);
                _layers.Insert(idx, layer);
            }

            // map has obviously changed here!
            if (this.MapChanged != null) { this.MapChanged(); }
        }
예제 #5
0
파일: Map.cs 프로젝트: UnifyKit/OsmSharp
 /// <summary>
 /// Called when a layer changed.
 /// </summary>
 /// <param name="sender"></param>
 void layer_LayerChanged(Layer sender)
 {
     if (this.MapChanged != null)
     {
         OsmSharp.Logging.Log.TraceEvent("Map.layer_LayerChanged (Before)", Logging.TraceEventType.Information,
             "RaiseLayerChanged");
         this.MapChanged();
         OsmSharp.Logging.Log.TraceEvent("Map.layer_LayerChanged (After)", Logging.TraceEventType.Information,
             "RaiseLayerChanged");
     }
 }
예제 #6
0
파일: Map.cs 프로젝트: nubix-biz/OsmSharp
 /// <summary>
 /// Removes the given layer.
 /// </summary>
 /// <param name="layer"></param>
 public bool RemoveLayer(Layer layer)
 {
     if (_layers.Remove(layer))
     {
         layer.LayerChanged -= new LayerChanged(layer_LayerChanged); // remove event handler.
         return true;
     }
     return false;
 }
예제 #7
0
파일: Map.cs 프로젝트: nubix-biz/OsmSharp
 /// <summary>
 /// Inserts a layer.
 /// </summary>
 /// <param name="idx"></param>
 /// <param name="layer"></param>
 public void InsertLayer(int idx, Layer layer)
 {
     layer.LayerChanged += new LayerChanged(layer_LayerChanged);
     _layers.Insert(idx, layer);
 }
예제 #8
0
파일: Map.cs 프로젝트: nubix-biz/OsmSharp
 /// <summary>
 /// Adds a layer on top of the existing layers.
 /// </summary>
 /// <param name="layer"></param>
 public void AddLayer(Layer layer)
 {
     layer.LayerChanged += new LayerChanged(layer_LayerChanged);
     _layers.Add(layer);
 }
예제 #9
0
 internal Boolean RemoveLayer(Layer layer)
 {
     return _map.RemoveLayer(layer);
 }