Skip to content

Commit be80cfb

Browse files
Update how-to-dev-guide-csharp-sdk.md
1 parent a32d599 commit be80cfb

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

articles/azure-maps/how-to-dev-guide-csharp-sdk.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ Call the `GetGeocoding` method to get the coordinate of an address.
140140

141141
```csharp
142142
using System;
143+
using Azure;
144+
using Azure.Maps.Search;
143145
using Azure.Maps.Search.Models;
146+
144147
// Use Azure Maps subscription key authentication
145148
var subscriptionKey = Environment.GetEnvironmentVariable("SUBSCRIPTION_KEY") ?? string.Empty;
146149
var credential = new AzureKeyCredential(subscriptionKey);
@@ -158,9 +161,12 @@ This sample demonstrates how to perform batch search address.
158161

159162
```csharp
160163
using System;
164+
using Azure;
165+
using Azure.Maps.Search;
161166
using System.Collections.Generic;
162167
using Azure.Maps.Search.Models;
163168
using Azure.Maps.Search.Models.Queries;
169+
164170
// Use Azure Maps subscription key authentication
165171
var subscriptionKey = Environment.GetEnvironmentVariable("SUBSCRIPTION_KEY") ?? string.Empty;
166172
var credential = new AzureKeyCredential(subscriptionKey);
@@ -170,7 +176,7 @@ List<GeocodingQuery> queries = new List<GeocodingQuery>
170176
{
171177
new GeocodingQuery()
172178
{
173-
Locality ="Seattle"
179+
Query ="15171 NE 24th St, Redmond, WA 98052, United States"
174180
},
175181
new GeocodingQuery()
176182
{
@@ -192,6 +198,8 @@ You can translate coordinates into human-readable street addresses. This process
192198

193199
```csharp
194200
using System;
201+
using Azure;
202+
using Azure.Maps.Search;
195203
using Azure.Core.GeoJson;
196204
using Azure.Maps.Search.Models;
197205

@@ -216,6 +224,8 @@ Azure Maps Search also provides some batch query APIs. The Reverse Geocoding Bat
216224

217225
```csharp
218226
using System;
227+
using Azure;
228+
using Azure.Maps.Search;
219229
using System.Collections.Generic;
220230
using Azure.Core.GeoJson;
221231
using Azure.Maps.Search.Models;
@@ -230,18 +240,20 @@ List<ReverseGeocodingQuery> items = new List<ReverseGeocodingQuery>
230240
{
231241
new ReverseGeocodingQuery()
232242
{
233-
Coordinates = new GeoPosition(-122.34255, 47.0)
243+
Coordinates = new GeoPosition(-122.349309, 47.620498)
234244
},
235245
new ReverseGeocodingQuery()
236246
{
237-
Coordinates = new GeoPosition(-122.34255, 47.0)
247+
Coordinates = new GeoPosition(-122.138679, 47.630356)
248+
ResultTypes = new List<ReverseGeocodingResultTypeEnum>(){ ReverseGeocodingResultTypeEnum.Address, ReverseGeocodingResultTypeEnum.Neighborhood}
238249
},
239250
};
240251
Response<GeocodingBatchResponse> result = client.GetReverseGeocodingBatch(items);
241252
//Print addresses
242253
for (var i = 0; i < result.Value.BatchItems.Count; i++)
243254
{
244255
Console.WriteLine(result.Value.BatchItems[i].Features[0].Properties.Address.AddressLine);
256+
Console.WriteLine(result.Value.BatchItems[i].Features[0].Properties.Address.Neighborhood);
245257
}
246258
```
247259

@@ -251,6 +263,8 @@ This sample demonstrates how to search polygons.
251263

252264
```csharp
253265
using System;
266+
using Azure;
267+
using Azure.Maps.Search;
254268
using Azure.Core.GeoJson;
255269
using Azure.Maps.Search.Models;
256270
using Azure.Maps.Search.Models.Options;

0 commit comments

Comments
 (0)