Skip to content

Commit 2dc6f62

Browse files
committed
Update how-to-dev-guide-java-sdk.md
1 parent 416e301 commit 2dc6f62

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.service: azure-maps
1010
services: azure-maps
1111
---
1212

13-
# Java REST SDK Developers Guide (preview)  
13+
# Java REST SDK Developers Guide (preview)
1414

1515
The Azure Maps Java SDK can be integrated with Java applications and libraries to build maps-related and location-aware applications. The Azure Maps Java SDK contains APIs for Search, Route, Render, Elevation, Geolocation, Traffic, Timezone, and Weather. These APIs support operations such as searching for an address, routing between different coordinates, obtaining the geo-location of a specific IP address etc.
1616

@@ -37,22 +37,22 @@ The following PowerShell code snippet demonstrates how to use PowerShell to crea
3737
3838
```powershell
3939
mvn archetype:generate "-DgroupId=groupId" "-DartifactId=DemoProject" "-DarchetypeArtifactId=maven-archetype-quickstart" "-DarchetypeVersion=1.4" "-DinteractiveMode=false" 
40-
``` 
40+
```
4141
4242
| Parameter | Description |
4343
|-------------|--------------------------------------------------------------|
4444
| `-DGroupId` | Group ID uniquely identifies your project across all projects|
4545
| `-DartifactId` | Project name. It will be created as a new folder. |
4646
| `-DarchetypeArtifactId` | project type. `maven-archetype-quickstart` results in a sample project. |
47-
| `-DinteractiveMode` | Setting to `false` results in a blank Java project with default options. | 
47+
| `-DinteractiveMode` | Setting to `false` results in a blank Java project with default options. |
4848

4949
### Install the packages
5050

51-
To use the Azure Maps Java SDK, you will need to install all required packages. Each service in Azure Maps is available in its own package. Services include Search, Render, Traffic, Weather, etc. You only need to install the packages for the service or services you will be using in your project.
51+
To use the Azure Maps Java SDK, you will need to install all required packages. Each service in Azure Maps is available in its own package. Services include Search, Render, Traffic, Weather, etc. You only need to install the packages for the service or services you will be using in your project.
5252

53-
After creating the maven project, there should be a `pom.xml` file with basic information such as group ID, name, artifact ID. This is where you will add a dependency for each of the Azure Maps services, as shown below: 
53+
After creating the maven project, there should be a `pom.xml` file with basic information such as group ID, name, artifact ID. This is where you will add a dependency for each of the Azure Maps services, as shown below:
5454

55-
```xml 
55+
```xml
5656
<dependency
5757
  <groupId>com.azure</groupId
5858
  <artifactId>azure-maps-search</artifactId
@@ -93,8 +93,8 @@ After creating the maven project, there should be a `pom.xml` file with basic in
9393
Run `mvn clean install` on your project, then create a java file named `demo.java` and import what you need from Azure maps into the file:
9494

9595
```powershell
96-
cd DemoProject
97-
New-Item demo.java 
96+
cd DemoProject
97+
New-Item demo.java
9898
```
9999

100100
> [!TIP]
@@ -161,10 +161,10 @@ public class Demo {
161161
builder.credential(tokenCredential);
162162
builder.mapsClientId(System.getenv("MAPS_CLIENT_ID"));
163163
MapsSearchClient client = builder.buildClient();
164-
} 
165-
} 
164+
}
165+
}
166166
``` 
167-
> [!Important] 
167+
> [!Important]
168168
> The other environment variables created above, while not used in the code sample here, are required by `DefaultAzureCredential()`. If you do not set these environment variables correctly, using the same naming conventions, you will get run-time errors. For example, if your `AZURE_CLIENT_ID` is missing or invalid you will get an `InvalidAuthenticationTokenTenant` error.
169169
170170
### Using a subscription key credential
@@ -196,9 +196,9 @@ public class Demo {
196196
MapsSearchClient client = builder.buildClient();
197197
}
198198
}
199-
``` 
199+
```
200200

201-
## Fuzzy search an entity 
201+
## Fuzzy search an entity
202202

203203
The following code snippet demonstrates how, in a simple console application, to import the `azure-maps-search` package and perform a fuzzy search on "Starbucks" near Seattle:
204204

@@ -250,10 +250,10 @@ public class Demo {
250250

251251
This code snippet demonstrates how to create a `MapsSearchClient` object using Azure credentials. Start by instantiating `AzureKeyCredential` using your Azure Maps subscription key, then passes the credentials to instantiate `MapsSearchClient`. `MapsSearchClient` methods such as `FuzzySearch` can use the point of interest (POI) name "Starbucks" and coordinates GeoPosition(-122.31, 47.61).
252252

253-
Execute the program from the project folder in the command line:  
253+
Execute the program from the project folder in the command line:
254254

255255
```powershell
256-
java .\demo.java 
256+
java .\demo.java
257257
```
258258

259259
You should see a list of Starbucks address and coordinate results:
@@ -335,9 +335,9 @@ public class Demo {
335335
SearchAddressResultItem item = results.getResults().get(0);
336336
System.out.format("The coordinates is (%.4f, %.4f)"
337337
    item.getPosition().getLatitude(), item.getPosition().getLongitude());
338-
} 
339-
} 
340-
} 
338+
}
339+
}
340+
}
341341
```
342342

343343
In this sample, the `client.SearchAddress` method returns results ordered by confidence score and prints the coordinates of the first result.
@@ -386,9 +386,9 @@ public class Demo{
386386
    for (ReverseSearchAddressResultItem result : item.getResult().getAddresses()) {
387387
        System.out.println(result.getAddress().getFreeformAddress());
388388
    }
389-
} 
390-
} 
391-
} 
389+
}
390+
}
391+
}
392392
```
393393

394394
[Azure Maps account]: quick-demo-map-app.md#create-an-azure-maps-account

0 commit comments

Comments
 (0)