You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-maps/how-to-dev-guide-java-sdk.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ ms.service: azure-maps
10
10
services: azure-maps
11
11
---
12
12
13
-
# Java REST SDK Developers Guide (preview)
13
+
# Java REST SDK Developers Guide (preview)
14
14
15
15
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.
16
16
@@ -37,22 +37,22 @@ The following PowerShell code snippet demonstrates how to use PowerShell to crea
|`-DGroupId`| Group ID uniquely identifies your project across all projects|
45
45
|`-DartifactId`| Project name. It will be created as a new folder. |
46
46
|`-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. |
48
48
49
49
### Install the packages
50
50
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.
52
52
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:
54
54
55
-
```xml
55
+
```xml
56
56
<dependency>
57
57
<groupId>com.azure</groupId>
58
58
<artifactId>azure-maps-search</artifactId>
@@ -93,8 +93,8 @@ After creating the maven project, there should be a `pom.xml` file with basic in
93
93
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:
> 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.
169
169
170
170
### Using a subscription key credential
@@ -196,9 +196,9 @@ public class Demo {
196
196
MapsSearchClient client = builder.buildClient();
197
197
}
198
198
}
199
-
```
199
+
```
200
200
201
-
## Fuzzy search an entity
201
+
## Fuzzy search an entity
202
202
203
203
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:
204
204
@@ -250,10 +250,10 @@ public class Demo {
250
250
251
251
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).
252
252
253
-
Execute the program from the project folder in the command line:
253
+
Execute the program from the project folder in the command line:
254
254
255
255
```powershell
256
-
java .\demo.java
256
+
java .\demo.java
257
257
```
258
258
259
259
You should see a list of Starbucks address and coordinate results:
0 commit comments