public IEnumerable CreateHeroCards()

in CSharp/BotBuilderLocation/LocationCardBuilder.cs [45:88]


        public IEnumerable<HeroCard> CreateHeroCards(IList<Location> locations, bool alwaysShowNumericPrefix = false, IList<string> locationNames = null)
        {
            var cards = new List<HeroCard>();

            int i = 1;

            foreach (var location in locations)
            {
                string nameString = locationNames == null ? string.Empty : $"{locationNames[i-1]}: ";
                string locationString = $"{nameString}{location.GetFormattedAddress(this.resourceManager.AddressSeparator)}";
                string address = alwaysShowNumericPrefix || locations.Count > 1 ? $"{i}. {locationString}" : locationString;

                var heroCard = new HeroCard
                {
                    Subtitle = address
                };

                if (location.Point != null)
                {
                    IGeoSpatialService geoService;

                    if (useAzureMaps)
                    {
                        geoService = new AzureMapsSpatialService(this.apiKey);
                    }
                    else
                    {
                        geoService = new BingGeoSpatialService(this.apiKey);
                    }

                    var image =
                        new CardImage(
                            url: geoService.GetLocationMapImageUrl(location, i));

                    heroCard.Images = new[] { image };
                }

                cards.Add(heroCard);

                i++;
            }

            return cards;
        }