public IDictionary <string, object> Serialize() { IDictionary <string, object> result = new Dictionary <string, object>(); FluentDictionary.For(result) .Add("elementType", ElementType != null ? ElementType.ToClientSideString() : null, () => ElementType != null) .Add("featureType", FeatureType != null ? FeatureType.ToClientSideString() : null, () => FeatureType != null) .Add("stylers", Stylers, () => Stylers.Any()); return(result); }
public virtual IDictionary <string, object> Serialize() { IDictionary <string, object> result = new Dictionary <string, object>(); FluentDictionary.For(result) .Add("altName", mapType.MapTypeAltName, () => !String.IsNullOrEmpty(mapType.MapTypeAltName)) .Add("name", mapType.MapTypeName) .Add("maxZoom", mapType.MaxZoom, 0) .Add("minZoom", mapType.MinZoom, 0) .Add("opacity", (mapType.Opacity / 100F), 1F) .Add("radius", mapType.Radius, 6378137); return(result); }
public override IDictionary <string, object> Serialize() { var customStyles = new List <IDictionary <string, object> >(); if (styledMapType.Styles.Any()) { styledMapType.Styles.Each(cs => customStyles.Add(cs.Serialize())); } IDictionary <string, object> result = base.Serialize(); FluentDictionary.For(result) .Add("styles", customStyles, () => styledMapType.Styles.Any()); return(result); }