void MoveLayerToBack(MapLayerViewModel layer) { //Debug.WriteLine(string.Format("MediatorMessage.MoveLayerToBack: {0}", layer.LayerOverlay.Name)); _wpfMap.Overlays.MoveToBottom(layer.Name); }
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); }
void MoveLayerBackward(MapLayerViewModel layer) { //Debug.WriteLine(string.Format("MediatorMessage.MoveLayerBackward: {0}", layer.LayerOverlay.Name)); _wpfMap.Overlays.MoveDown(layer.Name); }
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(); } }
void HideMapLayer(MapLayerViewModel layer) { SetIsVisible(layer, false); }
void ShowMapLayer(MapLayerViewModel layer) { SetIsVisible(layer, true); }
public void Remove(MapLayerViewModel layer) { _wpfMap.Overlays.Remove(layer.Name); }
public void Add(MapLayerViewModel layer) { if (!_wpfMap.Overlays.Contains(layer.Name)) _wpfMap.Overlays.Add(layer.Name, layer.LayerOverlay); }