bool IsSkipGeoid(MapItemAttribute attr) { if (attr == null || attr.Value == null) { return(true); } return(false); }
public static string GetItemImageSource(MapItem item) { if (item == null) { return(null); } MapItemAttribute attr = item.Attributes["IMAGESOURCE"]; return(attr != null ? (string)attr.Value : imagesGenerator.GetItemImagePath(item)); }
void ResetCountriesSelections(bool isAll) { foreach (MapItem item in FileLayer.Data.Items) { MapItemAttribute answerAttribute = item.Attributes[AnswerAttributeName]; if (answerAttribute != null && (answerAttribute.Value.Equals("Try") || isAll)) { item.Attributes.Remove(answerAttribute); } } }
void SetCountryTrySelection(MapItem item) { MapItemAttribute answerAttribute = item.Attributes[AnswerAttributeName]; if (answerAttribute != null) { return; } item.Attributes.Add(new MapItemAttribute() { Name = AnswerAttributeName, Value = "Try" }); }
void OnFileLoaded(object sender, ItemsLoadedEventArgs e) { foreach (var item in e.Items) { MapItemAttribute attr = new MapItemAttribute(); attr.Name = "RevenueYTD"; decimal value = 0; if (item.Attributes["NAME"] != null) { value = SalesPerformanceDataGenerator.Current.TotalSales.Where(d => string.Equals(d.State, item.Attributes["NAME"].Value.ToString())).Sum(d => d.RevenueYTD); } attr.Value = value; if (value == 0) { item.Visible = false; } item.Attributes.Add(attr); } }
private void AddOrMovePushpin(GeoCode geoCode) { GeoPoint geoPoint = new GeoPoint(geoCode.PushLat, geoCode.PushLong); MapPushpin pin = AddOrMovePushpin(geoPoint); //Since we only have one pin this isn't really necessary, but just showing how to add an attribute to a pushpin //which can later be used to match when retrieving the pin MapItemAttribute attrib = pin.Attributes.FirstOrDefault(a => a.Name == "id"); if (attrib == null) { pin.Attributes.Add(new MapItemAttribute() { Name = "id", Type = typeof(int), Value = geoCode.GeoCodeId }); } else { attrib.Value = geoCode.GeoCodeId; } }