コード例 #1
0
 void MoveLayerToBack(MapLayerViewModel layer)
 {
     //Debug.WriteLine(string.Format("MediatorMessage.MoveLayerToBack: {0}", layer.LayerOverlay.Name));
     _wpfMap.Overlays.MoveToBottom(layer.Name);
 }
コード例 #2
0
 public void Refresh(MapLayerViewModel layer)
 {
     if (layer == null || layer.LayerOverlay == null || layer.LayerOverlay.Layers == null || layer.LayerOverlay.Layers.Count <= 0) return;
     var layerOverlay = (LayerOverlay)_wpfMap.Overlays[layer.Name];
     if (layerOverlay == null || layerOverlay.Layers == null || layerOverlay.Layers.Count <= 0) return;
     if (layer.GetType() == typeof(ShapefileMapLayer))
         ((ShapeFileFeatureLayer)layerOverlay.Layers[0]).ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = layer.AreaStyle;
     else if (layer.GetType() == typeof(OverlayShapeMapLayer))
     {
         if (layer.CustomLineStyle != null)
         {
             ((InMemoryFeatureLayer)layerOverlay.Layers[0]).ZoomLevelSet.ZoomLevel01.CustomStyles.Clear();
             ((InMemoryFeatureLayer)layerOverlay.Layers[0]).ZoomLevelSet.ZoomLevel01.CustomStyles.Add(layer.CustomLineStyle);
         }
         else
         {
             if (layer.LineStyle != null)
             {
                 ((InMemoryFeatureLayer)layerOverlay.Layers[0]).ZoomLevelSet.ZoomLevel01.DefaultLineStyle = layer.LineStyle;
                 ((InMemoryFeatureLayer)layerOverlay.Layers[0]).ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = layer.AreaStyle;
             }
             if (layer.PointStyle != null) ((InMemoryFeatureLayer)layerOverlay.Layers[0]).ZoomLevelSet.ZoomLevel01.DefaultPointStyle = layer.PointStyle;
         }
     }
     _wpfMap.Refresh(layerOverlay);
 }
コード例 #3
0
 void MoveLayerBackward(MapLayerViewModel layer)
 {
     //Debug.WriteLine(string.Format("MediatorMessage.MoveLayerBackward: {0}", layer.LayerOverlay.Name));
     _wpfMap.Overlays.MoveDown(layer.Name);
 }
コード例 #4
0
 public void SetIsVisible(MapLayerViewModel layer, bool isVisible)
 {
     var layerOverlay = _wpfMap.Overlays[layer.Name];
     layerOverlay.IsVisible = isVisible;
     //layer.LayerOverlay.IsVisible = isVisible;
     try
     {
         _wpfMap.Refresh(layerOverlay);
     }
     catch (Exception)
     {
         _wpfMap.Overlays.Remove(layerOverlay);
         _wpfMap.Refresh();
     }
 }
コード例 #5
0
 void HideMapLayer(MapLayerViewModel layer) { SetIsVisible(layer, false); }
コード例 #6
0
 void ShowMapLayer(MapLayerViewModel layer) { SetIsVisible(layer, true); }
コード例 #7
0
 public void Remove(MapLayerViewModel layer) { _wpfMap.Overlays.Remove(layer.Name); }
コード例 #8
0
 public void Add(MapLayerViewModel layer) { if (!_wpfMap.Overlays.Contains(layer.Name)) _wpfMap.Overlays.Add(layer.Name, layer.LayerOverlay); }