private void RemoveIsolinesLayer(VisualizationDataSource removedDataSource) { IsolinesLayer layer = layers.Find(il => il.Guid == removedDataSource.Guid); if (layer != null) { RemoveLayerFromHost(layer); layers.Remove(layer); } }
private void RemoveLayerFromHost(IsolinesLayer layer) { if (layer.IsVisible) { foreach (PolylineGeometry geometry in layer.Geometry) { host.Geometry.RemoveGeometry(geometry.LayerId, geometry.Id); } foreach (VisualPushpin pushpin in layer.Labels) { host.Geometry.RemoveGeometry(pushpin.Pushpin.LayerId, pushpin.Pushpin.Id); } } }
private void AddLayerToHost(IsolinesLayer layer) { if (layer.IsVisible) { foreach (PolylineGeometry geometry in layer.Geometry) { host.Geometry.AddGeometry(geometry); } foreach (VisualPushpin pushpin in layer.Labels) { host.Geometry.AddGeometry(pushpin.Pushpin); } } }