5
5
6
6
import java .io .IOException ;
7
7
8
+ import com .azure .core .credential .AzureKeyCredential ;
8
9
import com .azure .core .http .policy .HttpLogDetailLevel ;
9
10
import com .azure .core .http .policy .HttpLogOptions ;
10
11
import com .azure .core .models .GeoBoundingBox ;
11
- import com .azure .identity .DefaultAzureCredential ;
12
- import com .azure .identity .DefaultAzureCredentialBuilder ;
13
12
import com .azure .maps .render .MapsRenderAsyncClient ;
14
13
import com .azure .maps .render .MapsRenderClient ;
15
14
import com .azure .maps .render .MapsRenderClientBuilder ;
@@ -19,19 +18,20 @@ public static void main(String[] args) throws IOException {
19
18
MapsRenderClientBuilder builder = new MapsRenderClientBuilder ();
20
19
21
20
// Authenticates using subscription key
22
- // AzureKeyCredential keyCredential = new AzureKeyCredential(System.getenv("SUBSCRIPTION_KEY"));
23
- // builder.credential(keyCredential);
21
+ AzureKeyCredential keyCredential = new AzureKeyCredential (System .getenv ("SUBSCRIPTION_KEY" ));
22
+ builder .credential (keyCredential );
24
23
25
24
// Authenticates using Azure AD building a default credential
26
25
// This will look for AZURE_CLIENT_ID, AZURE_TENANT_ID, and AZURE_CLIENT_SECRET env variables
27
- DefaultAzureCredential tokenCredential = new DefaultAzureCredentialBuilder ().build ();
26
+ // DefaultAzureCredential tokenCredential = new DefaultAzureCredentialBuilder().build();
27
+ // builder.credential(tokenCredential);
28
28
29
- builder .credential (tokenCredential );
30
29
builder .mapsClientId (System .getenv ("MAPS_CLIENT_ID" ));
31
30
builder .httpLogOptions (new HttpLogOptions ().setLogLevel (HttpLogDetailLevel .BODY_AND_HEADERS ));
32
31
MapsRenderClient client = builder .buildClient ();
33
32
34
- // Get Copyright From Bounding Box
33
+ // Get Copyright From Bounding Box
34
+ System .out .println ("Get Copyright From Bounding Box" );
35
35
// BEGIN: com.azure.maps.render.sync.get_copyright_from_bounding_box
36
36
GeoBoundingBox boundingBox = new GeoBoundingBox (52.41064 , 4.84228 , 52.41072 , 4.84239 );
37
37
client .getCopyrightFromBoundingBox (boundingBox , true );
@@ -40,19 +40,20 @@ public static void main(String[] args) throws IOException {
40
40
MapsRenderClientBuilder asyncClientbuilder = new MapsRenderClientBuilder ();
41
41
42
42
// Authenticates using subscription key
43
- // AzureKeyCredential keyCredential = new AzureKeyCredential(System.getenv("SUBSCRIPTION_KEY"));
44
- // builder .credential(keyCredential );
43
+ AzureKeyCredential asyncClientKeyCredential = new AzureKeyCredential (System .getenv ("SUBSCRIPTION_KEY" ));
44
+ asyncClientbuilder .credential (asyncClientKeyCredential );
45
45
46
46
// Authenticates using Azure AD building a default credential
47
47
// This will look for AZURE_CLIENT_ID, AZURE_TENANT_ID, and AZURE_CLIENT_SECRET env variables
48
- DefaultAzureCredential asyncClientTokenCredential = new DefaultAzureCredentialBuilder ().build ();
48
+ // DefaultAzureCredential asyncClientTokenCredential = new DefaultAzureCredentialBuilder().build();
49
+ // asyncClientbuilder.credential(asyncClientTokenCredential);
49
50
50
- asyncClientbuilder .credential (asyncClientTokenCredential );
51
51
asyncClientbuilder .mapsClientId (System .getenv ("MAPS_CLIENT_ID" ));
52
52
asyncClientbuilder .httpLogOptions (new HttpLogOptions ().setLogLevel (HttpLogDetailLevel .BODY_AND_HEADERS ));
53
53
MapsRenderAsyncClient asyncClient = asyncClientbuilder .buildAsyncClient ();
54
54
55
- // Get Copyright From Bounding Box
55
+ // Get Copyright From Bounding Box
56
+ System .out .println ("Get Copyright From Bounding Box" );
56
57
// BEGIN: com.azure.maps.render.async.get_copyright_from_bounding_box
57
58
GeoBoundingBox boundingBox2 = new GeoBoundingBox (52.41064 , 4.84228 , 52.41072 , 4.84239 );
58
59
asyncClient .getCopyrightFromBoundingBox (boundingBox2 , true ).block ();
0 commit comments