@@ -140,7 +140,10 @@ Call the `GetGeocoding` method to get the coordinate of an address.
140
140
141
141
``` csharp
142
142
using System ;
143
+ using Azure ;
144
+ using Azure .Maps .Search ;
143
145
using Azure .Maps .Search .Models ;
146
+
144
147
// Use Azure Maps subscription key authentication
145
148
var subscriptionKey = Environment .GetEnvironmentVariable (" SUBSCRIPTION_KEY" ) ?? string .Empty ;
146
149
var credential = new AzureKeyCredential (subscriptionKey );
@@ -158,9 +161,12 @@ This sample demonstrates how to perform batch search address.
158
161
159
162
``` csharp
160
163
using System ;
164
+ using Azure ;
165
+ using Azure .Maps .Search ;
161
166
using System .Collections .Generic ;
162
167
using Azure .Maps .Search .Models ;
163
168
using Azure .Maps .Search .Models .Queries ;
169
+
164
170
// Use Azure Maps subscription key authentication
165
171
var subscriptionKey = Environment .GetEnvironmentVariable (" SUBSCRIPTION_KEY" ) ?? string .Empty ;
166
172
var credential = new AzureKeyCredential (subscriptionKey );
@@ -170,7 +176,7 @@ List<GeocodingQuery> queries = new List<GeocodingQuery>
170
176
{
171
177
new GeocodingQuery ()
172
178
{
173
- Locality = " Seattle "
179
+ Query = " 15171 NE 24th St, Redmond, WA 98052, United States "
174
180
},
175
181
new GeocodingQuery ()
176
182
{
@@ -192,6 +198,8 @@ You can translate coordinates into human-readable street addresses. This process
192
198
193
199
``` csharp
194
200
using System ;
201
+ using Azure ;
202
+ using Azure .Maps .Search ;
195
203
using Azure .Core .GeoJson ;
196
204
using Azure .Maps .Search .Models ;
197
205
@@ -216,6 +224,8 @@ Azure Maps Search also provides some batch query APIs. The Reverse Geocoding Bat
216
224
217
225
``` csharp
218
226
using System ;
227
+ using Azure ;
228
+ using Azure .Maps .Search ;
219
229
using System .Collections .Generic ;
220
230
using Azure .Core .GeoJson ;
221
231
using Azure .Maps .Search .Models ;
@@ -230,18 +240,20 @@ List<ReverseGeocodingQuery> items = new List<ReverseGeocodingQuery>
230
240
{
231
241
new ReverseGeocodingQuery ()
232
242
{
233
- Coordinates = new GeoPosition (- 122 . 34255 , 47 . 0 )
243
+ Coordinates = new GeoPosition (- 122 . 349309 , 47 . 620498 )
234
244
},
235
245
new ReverseGeocodingQuery ()
236
246
{
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 }
238
249
},
239
250
};
240
251
Response < GeocodingBatchResponse > result = client .GetReverseGeocodingBatch (items );
241
252
// Print addresses
242
253
for (var i = 0 ; i < result .Value .BatchItems .Count ; i ++ )
243
254
{
244
255
Console .WriteLine (result .Value .BatchItems [i ].Features [0 ].Properties .Address .AddressLine );
256
+ Console .WriteLine (result .Value .BatchItems [i ].Features [0 ].Properties .Address .Neighborhood );
245
257
}
246
258
```
247
259
@@ -251,6 +263,8 @@ This sample demonstrates how to search polygons.
251
263
252
264
``` csharp
253
265
using System ;
266
+ using Azure ;
267
+ using Azure .Maps .Search ;
254
268
using Azure .Core .GeoJson ;
255
269
using Azure .Maps .Search .Models ;
256
270
using Azure .Maps .Search .Models .Options ;
0 commit comments