From 5a46c8af86403619cb0348b1ee05634c6cc917d6 Mon Sep 17 00:00:00 2001 From: Ryan Lengel Isgrig Date: Wed, 24 Apr 2019 20:40:11 -0700 Subject: [PATCH 1/2] Foursquare best photo is set to 440x240 dimensions, same as Azure Maps photo. --- .../Shared/Resources/Cards/PointOfInterestDetails.json | 2 -- .../Resources/Cards/PointOfInterestDetailsWithRoute.json | 2 -- .../Dialogs/Shared/Resources/POISharedResponses.json | 8 ++++++-- .../pointofinterestskill/Models/PointofInterestModel.cs | 2 +- .../ServiceClients/AzureMapsGeoSpatialService.cs | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Dialogs/Shared/Resources/Cards/PointOfInterestDetails.json b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Dialogs/Shared/Resources/Cards/PointOfInterestDetails.json index d4672630e5..fe233a65fd 100644 --- a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Dialogs/Shared/Resources/Cards/PointOfInterestDetails.json +++ b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Dialogs/Shared/Resources/Cards/PointOfInterestDetails.json @@ -102,8 +102,6 @@ { "type": "Image", "size": "auto", - "height": "240px", - "width": "380px", "horizontalAlignment": "center", "url": "{PointOfInterestImageUrl}" } diff --git a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Dialogs/Shared/Resources/Cards/PointOfInterestDetailsWithRoute.json b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Dialogs/Shared/Resources/Cards/PointOfInterestDetailsWithRoute.json index 48c102939e..bf94576233 100644 --- a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Dialogs/Shared/Resources/Cards/PointOfInterestDetailsWithRoute.json +++ b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Dialogs/Shared/Resources/Cards/PointOfInterestDetailsWithRoute.json @@ -102,8 +102,6 @@ { "type": "Image", "size": "auto", - "height": "240px", - "width": "380px", "horizontalAlignment": "center", "url": "{PointOfInterestImageUrl}" } diff --git a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Dialogs/Shared/Resources/POISharedResponses.json b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Dialogs/Shared/Resources/POISharedResponses.json index 86b087ef21..941bf8ed4e 100644 --- a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Dialogs/Shared/Resources/POISharedResponses.json +++ b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Dialogs/Shared/Resources/POISharedResponses.json @@ -234,6 +234,10 @@ { "text": "Which one?", "speak": "Which one?" + }, + { + "text": "One of these?", + "speak": "One of these?" } ], "inputHint": "expectingInput" @@ -277,8 +281,8 @@ "PromptForCurrentLocation": { "replies": [ { - "text": "What address are you at?", - "speak": "What address are you at?" + "text": "What's your address?", + "speak": "What's your address?" }, { "text": "Where are you? Try providing a city or address.", diff --git a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Models/PointofInterestModel.cs b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Models/PointofInterestModel.cs index e694d072ea..fbc8c0ad48 100644 --- a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Models/PointofInterestModel.cs +++ b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Models/PointofInterestModel.cs @@ -68,7 +68,7 @@ public PointOfInterestModel(Venue foursquarePoi) ? foursquarePoi.Id : Id; PointOfInterestImageUrl = !string.IsNullOrEmpty(foursquarePoi.BestPhoto?.AbsoluteUrl) - ? foursquarePoi.BestPhoto?.AbsoluteUrl + ? $"{foursquarePoi.BestPhoto?.Prefix}440x240{foursquarePoi.BestPhoto?.Suffix}" : PointOfInterestImageUrl; Name = !string.IsNullOrEmpty(foursquarePoi.Name) ? foursquarePoi.Name diff --git a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/ServiceClients/AzureMapsGeoSpatialService.cs b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/ServiceClients/AzureMapsGeoSpatialService.cs index 3ecdbbba1a..41671d5b85 100644 --- a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/ServiceClients/AzureMapsGeoSpatialService.cs +++ b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/ServiceClients/AzureMapsGeoSpatialService.cs @@ -21,7 +21,7 @@ public sealed class AzureMapsGeoSpatialService : IGeoSpatialService private static readonly string FindAddressByCoordinateUrl = $"https://atlas.microsoft.com/search/address/reverse/json?api-version=1.0&query={{0}},{{1}}"; private static readonly string FindNearbyUrl = $"https://atlas.microsoft.com/search/nearby/json?api-version=1.0&lat={{0}}&lon={{1}}&radius={{2}}&limit={{3}}"; private static readonly string FindByCategoryUrl = $"https://atlas.microsoft.com/search/poi/category/json?api-version=1.0&query={{2}}&lat={{0}}&lon={{1}}&radius={{3}}&limit={{4}}"; - private static readonly string ImageUrlByPoint = $"https://atlas.microsoft.com/map/static/png?api-version=1.0&layer=basic&style=main&zoom={{2}}¢er={{1}},{{0}}&width=380&height=240"; + private static readonly string ImageUrlByPoint = $"https://atlas.microsoft.com/map/static/png?api-version=1.0&layer=basic&style=main&zoom={{2}}¢er={{1}},{{0}}&width=440&height=240"; private static readonly string GetRouteDirections = $"https://atlas.microsoft.com/route/directions/json?&api-version=1.0&instructionsType=text&query={{0}}"; private static readonly string GetRouteDirectionsWithRouteType = $"https://atlas.microsoft.com/route/directions/json?&api-version=1.0&instructionsType=text&query={{0}}&&routeType={{1}}"; private static string apiKey; From 5acebcdeab2f6a5243ace9f33457fd3ba1a4e6e2 Mon Sep 17 00:00:00 2001 From: Ryan Lengel Isgrig Date: Wed, 24 Apr 2019 22:12:55 -0700 Subject: [PATCH 2/2] fix test --- .../API/AzureMapsGeoSpatialServiceTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskilltests/API/AzureMapsGeoSpatialServiceTests.cs b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskilltests/API/AzureMapsGeoSpatialServiceTests.cs index 4396847f0f..67a745bf12 100644 --- a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskilltests/API/AzureMapsGeoSpatialServiceTests.cs +++ b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskilltests/API/AzureMapsGeoSpatialServiceTests.cs @@ -45,7 +45,7 @@ public async Task GetPointOfInterestDetailsTest() var pointOfInterest = await service.GetPointOfInterestDetailsAsync(pointOfInterestList[0]); - Assert.AreEqual(pointOfInterest.PointOfInterestImageUrl, string.Format("https://atlas.microsoft.com/map/static/png?api-version=1.0&layer=basic&style=main&zoom={2}¢er={1},{0}&width=380&height=240&subscription-key={3}", pointOfInterestList[0].Geolocation.Latitude, pointOfInterestList[0].Geolocation.Longitude, 14, MockData.Key)); + Assert.AreEqual(pointOfInterest.PointOfInterestImageUrl, string.Format("https://atlas.microsoft.com/map/static/png?api-version=1.0&layer=basic&style=main&zoom={2}¢er={1},{0}&width=440&height=240&subscription-key={3}", pointOfInterestList[0].Geolocation.Latitude, pointOfInterestList[0].Geolocation.Longitude, 14, MockData.Key)); } [TestMethod]