Exemplo n.º 1
0
 bool IsSkipGeoid(MapItemAttribute attr)
 {
     if (attr == null || attr.Value == null)
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
 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);
         }
     }
 }
Exemplo n.º 4
0
        void SetCountryTrySelection(MapItem item)
        {
            MapItemAttribute answerAttribute = item.Attributes[AnswerAttributeName];

            if (answerAttribute != null)
            {
                return;
            }
            item.Attributes.Add(new MapItemAttribute()
            {
                Name = AnswerAttributeName, Value = "Try"
            });
        }
Exemplo n.º 5
0
 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);
     }
 }
Exemplo n.º 6
0
        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;
            }
        }