Skip to content

feat: Per-Request Language Option for Map Queries #48763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 51 additions & 21 deletions sdk/maps/Azure.Maps.Search/src/Generated/SearchRestClient.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
};
}

return await RestClient.GetGeocodingAsync(options?.Top, query, options?.AddressLine, options?.CountryRegion, boundingBox, localizedMapView, coordinates, options?.AdminDistrict, options?.AdminDistrict2, options?.AdminDistrict3, options?.Locality, options?.PostalCode, cancellationToken).ConfigureAwait(false);
return await RestClient.GetGeocodingAsync(options?.Top, query, options?.AddressLine, options?.CountryRegion, boundingBox, localizedMapView, coordinates, options?.AdminDistrict, options?.AdminDistrict2, options?.AdminDistrict3, options?.Locality, options?.PostalCode, options?.AcceptLanguage, cancellationToken).ConfigureAwait(false);

Check failure on line 168 in sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs

View check run for this annotation

Azure Pipelines / net - maps - ci (Build Analyze)

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs#L168

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs(168,41): Error CS1501: No overload for method 'GetGeocodingAsync' takes 14 arguments

Check failure on line 168 in sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs

View check run for this annotation

Azure Pipelines / net - maps - ci (Build Analyze)

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs#L168

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs(168,41): Error CS1501: No overload for method 'GetGeocodingAsync' takes 14 arguments

Check failure on line 168 in sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs

View check run for this annotation

Azure Pipelines / net - maps - ci

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs#L168

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs(168,41): Error CS1501: No overload for method 'GetGeocodingAsync' takes 14 arguments

Check failure on line 168 in sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs

View check run for this annotation

Azure Pipelines / net - maps - ci

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs#L168

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs(168,41): Error CS1501: No overload for method 'GetGeocodingAsync' takes 14 arguments

Check failure on line 168 in sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Analyze PRBatch)

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs#L168

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs(168,41): Error CS1501: No overload for method 'GetGeocodingAsync' takes 14 arguments

Check failure on line 168 in sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Analyze PRBatch)

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs#L168

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs(168,41): Error CS1501: No overload for method 'GetGeocodingAsync' takes 14 arguments

Check failure on line 168 in sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs

View check run for this annotation

Azure Pipelines / net - pullrequest

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs#L168

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs(168,41): Error CS1501: No overload for method 'GetGeocodingAsync' takes 14 arguments

Check failure on line 168 in sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs

View check run for this annotation

Azure Pipelines / net - pullrequest

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs#L168

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs(168,41): Error CS1501: No overload for method 'GetGeocodingAsync' takes 14 arguments
}
catch (Exception e)
{
Expand Down Expand Up @@ -207,7 +207,7 @@
};
}

return RestClient.GetGeocoding(options?.Top, query, options?.AddressLine, options?.CountryRegion, boundingBox, localizedMapView, coordinates, options?.AdminDistrict, options?.AdminDistrict2, options?.AdminDistrict3, options?.Locality, options?.PostalCode, cancellationToken);
return RestClient.GetGeocoding(options?.Top, query, options?.AddressLine, options?.CountryRegion, boundingBox, localizedMapView, coordinates, options?.AdminDistrict, options?.AdminDistrict2, options?.AdminDistrict3, options?.Locality, options?.PostalCode, options?.AcceptLanguage, cancellationToken);

Check failure on line 210 in sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs

View check run for this annotation

Azure Pipelines / net - maps - ci (Build Analyze)

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs#L210

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs(210,35): Error CS1501: No overload for method 'GetGeocoding' takes 14 arguments

Check failure on line 210 in sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs

View check run for this annotation

Azure Pipelines / net - maps - ci (Build Analyze)

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs#L210

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs(210,35): Error CS1501: No overload for method 'GetGeocoding' takes 14 arguments

Check failure on line 210 in sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs

View check run for this annotation

Azure Pipelines / net - maps - ci

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs#L210

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs(210,35): Error CS1501: No overload for method 'GetGeocoding' takes 14 arguments

Check failure on line 210 in sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs

View check run for this annotation

Azure Pipelines / net - maps - ci

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs#L210

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs(210,35): Error CS1501: No overload for method 'GetGeocoding' takes 14 arguments

Check failure on line 210 in sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Analyze PRBatch)

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs#L210

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs(210,35): Error CS1501: No overload for method 'GetGeocoding' takes 14 arguments

Check failure on line 210 in sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Analyze PRBatch)

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs#L210

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs(210,35): Error CS1501: No overload for method 'GetGeocoding' takes 14 arguments

Check failure on line 210 in sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs

View check run for this annotation

Azure Pipelines / net - pullrequest

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs#L210

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs(210,35): Error CS1501: No overload for method 'GetGeocoding' takes 14 arguments
}
catch (Exception e)
{
Expand Down Expand Up @@ -284,7 +284,7 @@
Convert.ToDouble(options.Coordinates.Longitude, CultureInfo.InvariantCulture.NumberFormat)
};
}
var boundaryInternal = await RestClient.GetPolygonAsync(coordinates, localizedMapView, options?.ResultType, options?.Resolution, cancellationToken).ConfigureAwait(false);
var boundaryInternal = await RestClient.GetPolygonAsync(coordinates, localizedMapView, options?.ResultType, options?.Resolution, options?.AcceptLanguage, cancellationToken).ConfigureAwait(false);

Check failure on line 287 in sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs

View check run for this annotation

Azure Pipelines / net - maps - ci (Build Analyze)

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs#L287

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs(287,57): Error CS1501: No overload for method 'GetPolygonAsync' takes 6 arguments

Check failure on line 287 in sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Analyze PRBatch)

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs#L287

sdk/maps/Azure.Maps.Search/src/MapsSearchClient.cs(287,57): Error CS1501: No overload for method 'GetPolygonAsync' takes 6 arguments
return Response.FromValue(new Boundary(boundaryInternal.Value), boundaryInternal.GetRawResponse());
}
catch (Exception e)
Expand Down Expand Up @@ -318,7 +318,7 @@
{
coordinates = new[] { (double)options.Coordinates.Longitude, (double)options.Coordinates.Latitude };
}
var boundaryInternal = RestClient.GetPolygon(coordinates, localizedMapView, options?.ResultType, options?.Resolution, cancellationToken);
var boundaryInternal = RestClient.GetPolygon(coordinates, localizedMapView, options?.ResultType, options?.Resolution, options?.AcceptLanguage, cancellationToken);
return Response.FromValue(new Boundary(boundaryInternal.Value), boundaryInternal.GetRawResponse());
}
catch (Exception e)
Expand Down Expand Up @@ -355,7 +355,7 @@
coordinatesList = new[] { coordinates.Longitude, coordinates.Latitude };
}

return await RestClient.GetReverseGeocodingAsync(coordinatesList, options?.ResultTypes, localizedMapView, cancellationToken).ConfigureAwait(false);
return await RestClient.GetReverseGeocodingAsync(coordinatesList, options?.ResultTypes, localizedMapView, options?.AcceptLanguage, cancellationToken).ConfigureAwait(false);
}
catch (Exception e)
{
Expand Down Expand Up @@ -390,7 +390,7 @@
{
coordinatesList = new[] { coordinates.Longitude, coordinates.Latitude };
}
return RestClient.GetReverseGeocoding(coordinatesList, options?.ResultTypes, localizedMapView, cancellationToken);
return RestClient.GetReverseGeocoding(coordinatesList, options?.ResultTypes, localizedMapView, options?.AcceptLanguage, cancellationToken);
}
catch (Exception e)
{
Expand Down
6 changes: 6 additions & 0 deletions sdk/maps/Azure.Maps.Search/src/Models/GeocodingQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,11 @@ public class GeocodingQuery

/// <summary>A point on the earth specified as a longitude and latitude. When you specify this parameter, the user’s location is taken into account and the results returned may be more relevant to the user. Example: <c>GeoPosition(lon, lat)</c></summary>
public GeoPosition? Coordinates { get; set; }

/// <summary>
/// Language in which search results should be returned.
/// Please refer to [Supported Languages](/azure/azure-maps/supported-languages) for details.
/// </summary>
public string AcceptLanguage { get; set; }
}
}
Loading
Loading