protected override void WriteElementContents(Client.Layer layer) { base.WriteElementContents(layer); HeatMapLayer heatMapLayer = layer as HeatMapLayer; if (heatMapLayer != null) { #region Gradient if (heatMapLayer.Gradient != null) { writer.WriteStartElement(Constants.esriPrefix, "HeatMapLayer.Gradient", Constants.esriNamespace); writer.WriteStartElement("GradientStopCollection"); foreach (GradientStop gradient in heatMapLayer.Gradient) { writer.WriteStartElement("GradientStop"); if (gradient.Color != null) { writer.WriteAttributeString("Color", gradient.Color.ToString(CultureInfo.InvariantCulture)); } if (gradient.Offset != 0) { writer.WriteAttributeString("Offset", gradient.Offset.ToString(CultureInfo.InvariantCulture)); } writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteEndElement(); } #endregion #region Heat Map Points if (heatMapLayer.HeatMapPoints != null) { writer.WriteStartElement(Constants.esriPrefix, "HeatMapLayer.HeatMapPoints", Constants.esriNamespace); writer.WriteStartElement(Constants.esriPrefix, "PointCollection", Constants.esriNamespace); foreach (MapPoint heatMapPoint in heatMapLayer.HeatMapPoints) { writer.WriteStartElement(Constants.esriPrefix, "MapPoint", Constants.esriNamespace); writer.WriteAttributeString("X", heatMapPoint.X.ToString(CultureInfo.InvariantCulture)); writer.WriteAttributeString("Y", heatMapPoint.Y.ToString(CultureInfo.InvariantCulture)); if (heatMapPoint.SpatialReference != null) { writer.WriteStartElement(Constants.esriPrefix, "MapPoint.SpatialReference", Constants.esriNamespace); writeSpatialReference(writer, heatMapPoint.SpatialReference); writer.WriteEndElement(); } writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteEndElement(); } #endregion } }
public override void SwitchBaseMapLayer(Client.Layer oldLayer, Core.BaseMapInfo newBaseMapInfo) { OpenStreetMapLayer osmLayer = oldLayer as OpenStreetMapLayer; if (osmLayer != null) { osmLayer.Style = getMapStyle(newBaseMapInfo); osmLayer.SetValue(ESRI.ArcGIS.Client.Extensibility.MapApplication.LayerNameProperty, newBaseMapInfo.DisplayName); } }
public override void SwitchBaseMapLayer(Client.Layer oldLayer, Core.BaseMapInfo newBaseMapInfo) { TileLayer tileLayer = oldLayer as TileLayer; if (tileLayer != null) { tileLayer.LayerStyle = getTileLayerTypeForBingMaps(newBaseMapInfo); tileLayer.SetValue(ESRI.ArcGIS.Client.Extensibility.MapApplication.LayerNameProperty, newBaseMapInfo.DisplayName); } }
protected override void WriteAttributes(Client.Layer layer) { base.WriteAttributes(layer); HeatMapLayer heatMapLayer = layer as HeatMapLayer; if (heatMapLayer != null) { if (heatMapLayer.Intensity != 10.0) { writer.WriteAttributeString("Intensity", heatMapLayer.Intensity.ToString(CultureInfo.InvariantCulture)); } } }
public override void SwitchBaseMapLayer(Client.Layer oldLayer, BaseMapInfo newBaseMapInfo) { Client.ArcGISTiledMapServiceLayer tiledLayer = oldLayer as Client.ArcGISTiledMapServiceLayer; if (tiledLayer != null) { // Apply proxy if one is in use or clear it if not if (newBaseMapInfo.UseProxy) { tiledLayer.ProxyURL = ProxyUrl; LayerExtensions.SetUsesProxy(tiledLayer, true); } else { tiledLayer.ProxyURL = null; LayerExtensions.SetUsesProxy(tiledLayer, false); } tiledLayer.Url = newBaseMapInfo.Url; tiledLayer.SetValue(ESRI.ArcGIS.Client.Extensibility.MapApplication.LayerNameProperty, newBaseMapInfo.DisplayName); } }
public override bool CanSwitchBaseMapLayer(Client.Layer layer) { return(layer is ArcGISTiledMapServiceLayer && ((ArcGISTiledMapServiceLayer)layer).ProxyURL == ProxyUrl); }
public abstract void SwitchBaseMapLayer(Client.Layer oldLayer, BaseMapInfo newBaseMapInfo);
public abstract bool CanSwitchBaseMapLayer(Client.Layer layer);
public override bool CanSwitchBaseMapLayer(Client.Layer layer) { return(layer is OpenStreetMapLayer); }
public override bool CanSwitchBaseMapLayer(Client.Layer layer) { return(layer is TileLayer); }