Class MapsRenderAsyncClient

java.lang.Object
com.azure.maps.render.MapsRenderAsyncClient

public final class MapsRenderAsyncClient extends Object
Initializes a new instance of the asynchronous RenderClient type. Creating an async client using a AzureKeyCredential:
 // Authenticates using subscription key
 AzureKeyCredential keyCredential = new AzureKeyCredential(System.getenv("SUBSCRIPTION_KEY"));

 // Creates a builder
 MapsRenderClientBuilder builder = new MapsRenderClientBuilder();
 builder.credential(keyCredential);
 builder.httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS));

 // Builds the client
 MapsRenderAsyncClient client = builder.buildAsyncClient();
 
Creating an async client using a TokenCredential:
 // Authenticates using Azure AD building a default credential
 // This will look for AZURE_CLIENT_ID, AZURE_TENANT_ID, and AZURE_CLIENT_SECRET env variables
 DefaultAzureCredential tokenCredential = new DefaultAzureCredentialBuilder().build();

 // Creates a builder
 MapsRenderClientBuilder builder = new MapsRenderClientBuilder();
 builder.credential(tokenCredential);
 builder.mapsClientId(System.getenv("MAPS_CLIENT_ID"));
 builder.httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS));

 // Builds a client
 MapsRenderAsyncClient client = builder.buildAsyncClient();
 
  • Method Details

    • getMapTile

      public Mono<com.azure.core.util.BinaryData> getMapTile(MapTileOptions options)
      Get Map Tile
       System.out.println("Get Map Tile");
       MapTileOptions mapTileOptions2 = new MapTileOptions();
       mapTileOptions.setTilesetId(TilesetId.MICROSOFT_BASE_ROAD);
       mapTileOptions.setTileIndex(new TileIndex().setX(10).setY(22).setZ(6));
       asyncClient.getMapTile(mapTileOptions2).block().toStream();
       
      The Get Map Tiles API allows users to request map tiles in vector or raster formats typically to be integrated into a map control or SDK.
      Parameters:
      options - the MapTileOptions to control the API behavior.
      Returns:
      the map tile as a BinaryData
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getMapTileWithResponse

      public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> getMapTileWithResponse(MapTileOptions options)
      Get Map Tile
       System.out.println("Get Map Tile");
       MapTileOptions mapTileOptions2 = new MapTileOptions();
       mapTileOptions.setTilesetId(TilesetId.MICROSOFT_BASE_ROAD);
       mapTileOptions.setTileIndex(new TileIndex().setX(10).setY(22).setZ(6));
       asyncClient.getMapTile(mapTileOptions2).block().toStream();
       
      The Get Map Tiles API allows users to request map tiles in vector or raster formats typically to be integrated into a map control or SDK.
      Parameters:
      options - the MapTileOptions to control the API behavior.
      Returns:
      the tile as a Mono<Response<BinaryData>>
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getMapTileset

      public Mono<MapTileset> getMapTileset(TilesetId tilesetId)
      Get Map Tileset The Get Map Tileset API allows users to request metadata for a tileset.
       System.out.println("Get Map Tileset");
       new TilesetId();
       asyncClient.getMapTileset(TilesetId.MICROSOFT_BASE).block();
       
      Parameters:
      tilesetId - the tileset id.
      Returns:
      metadata for a tileset in the TileJSON format.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getMapTilesetWithResponse

      public Mono<com.azure.core.http.rest.Response<MapTileset>> getMapTilesetWithResponse(TilesetId tilesetId)
      Get Map Tileset The Get Map Tileset API allows users to request metadata for a tileset.
       System.out.println("Get Map Tileset");
       new TilesetId();
       asyncClient.getMapTileset(TilesetId.MICROSOFT_BASE).block();
       
      Parameters:
      tilesetId - the tileset id.
      Returns:
      metadata for a tileset in the TileJSON format.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getMapAttribution

      public Mono<MapAttribution> getMapAttribution(TilesetId tilesetId, int zoom, com.azure.core.models.GeoBoundingBox bounds)
      Get Map Attribution
       System.out.println("Get Map Attribution");
       GeoBoundingBox bounds2 = new GeoBoundingBox(-122.414162, 47.57949, -122.247157, 47.668372);
       new TilesetId();
       asyncClient.getMapAttribution(TilesetId.MICROSOFT_BASE, 6, bounds2).block();
       
      Parameters:
      tilesetId - the tileset id.
      zoom - Zoom level for the desired map attribution.
      bounds - the GeoBoundingBox surrounding the area for which attribution is needed.
      Returns:
      copyright attribution for the requested section of a tileset.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getMapAttributionWithResponse

      public Mono<com.azure.core.http.rest.Response<MapAttribution>> getMapAttributionWithResponse(TilesetId tilesetId, int zoom, com.azure.core.models.GeoBoundingBox bounds)
      Get Map Attribution
       System.out.println("Get Map Attribution");
       GeoBoundingBox bounds2 = new GeoBoundingBox(-122.414162, 47.57949, -122.247157, 47.668372);
       new TilesetId();
       asyncClient.getMapAttribution(TilesetId.MICROSOFT_BASE, 6, bounds2).block();
       
      Parameters:
      tilesetId - the tileset id.
      zoom - Zoom level for the desired map attribution.
      bounds - the GeoBoundingBox surrounding the area for which attribution is needed.
      Returns:
      copyright attribution for the requested section of a tileset.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • downloadMapStateTile

      public Mono<com.azure.core.util.BinaryData> downloadMapStateTile(String statesetId, TileIndex tileIndex)
      Download Map State Tile
      Parameters:
      statesetId - The stateset id
      tileIndex - Parameter group
      Returns:
      the map tile
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • downloadMapStateTileWithResponse

      public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> downloadMapStateTileWithResponse(String statesetId, TileIndex tileIndex)
      Download Map State Tile
      Parameters:
      statesetId - The stateset id
      tileIndex - Parameter group
      Returns:
      the map tile
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getCopyrightCaption

      public Mono<CopyrightCaption> getCopyrightCaption()
      Get Copyright Caption Copyrights API is designed to serve copyright information for Render Tile service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries. As an alternative to copyrights for map request, one can receive captions for displaying the map provider information on the map.
       System.out.println("Get Copyright Caption");
       asyncClient.getCopyrightCaption().block();
       
      Returns:
      this object is returned from a successful copyright call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getCopyrightCaptionWithResponse

      public Mono<com.azure.core.http.rest.Response<CopyrightCaption>> getCopyrightCaptionWithResponse()
      Get Copyright Caption Copyrights API is designed to serve copyright information for Render Tile service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries. As an alternative to copyrights for map request, one can receive captions for displaying the map provider information on the map.
       System.out.println("Get Copyright Caption");
       asyncClient.getCopyrightCaption().block();
       
      Returns:
      this object is returned from a successful copyright call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getMapStaticImage

      public Mono<com.azure.core.util.BinaryData> getMapStaticImage(MapStaticImageOptions options)
      Get Map Static Image The static image service renders a user-defined, rectangular image containing a map section using a zoom level from 0 to 20. The static image service renders a user-defined, rectangular image containing a map section using a zoom level from 0 to 20. The supported resolution range for the map image is from 1x1 to 8192x8192. If you are deciding when to use the static image service over the map tile service, you may want to consider how you would like to interact with the rendered map. If the map contents will be relatively unchanging, a static map is a good choice. If you want to support a lot of zooming, panning and changing of the map content, the map tile service would be a better choice.
       System.out.println("Get Map Static Image");
       GeoBoundingBox bbox2 = new GeoBoundingBox(1.355233, 42.982261, 24.980233, 56.526017);
       new StaticMapLayer();
       new RasterTileFormat();
       MapStaticImageOptions mapStaticImageOptions2 = new MapStaticImageOptions().setStaticMapLayer(StaticMapLayer.BASIC)
           .setMapImageStyle(MapImageStyle.MAIN).setZoom(2)
           .setBoundingBox(bbox2).setRasterTileFormat(RasterTileFormat.PNG);
       asyncClient.getMapStaticImage(mapStaticImageOptions2).block().toStream();
       
      Parameters:
      options - the MapStaticImageOptions used in the call.
      Returns:
      the static map image as a Flux<ByteBuffer>
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getMapStaticImageWithResponse

      public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> getMapStaticImageWithResponse(MapStaticImageOptions options)
      Get Map Static Image The static image service renders a user-defined, rectangular image containing a map section using a zoom level from 0 to 20. The static image service renders a user-defined, rectangular image containing a map section using a zoom level from 0 to 20. The supported resolution range for the map image is from 1x1 to 8192x8192. If you are deciding when to use the static image service over the map tile service, you may want to consider how you would like to interact with the rendered map. If the map contents will be relatively unchanging, a static map is a good choice. If you want to support a lot of zooming, panning and changing of the map content, the map tile service would be a better choice.
       System.out.println("Get Map Static Image");
       GeoBoundingBox bbox2 = new GeoBoundingBox(1.355233, 42.982261, 24.980233, 56.526017);
       new StaticMapLayer();
       new RasterTileFormat();
       MapStaticImageOptions mapStaticImageOptions2 = new MapStaticImageOptions().setStaticMapLayer(StaticMapLayer.BASIC)
           .setMapImageStyle(MapImageStyle.MAIN).setZoom(2)
           .setBoundingBox(bbox2).setRasterTileFormat(RasterTileFormat.PNG);
       asyncClient.getMapStaticImage(mapStaticImageOptions2).block().toStream();
       
      Parameters:
      options - the MapStaticImageOptions used in the call.
      Returns:
      the static map image.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getCopyrightFromBoundingBox

      public Mono<Copyright> getCopyrightFromBoundingBox(com.azure.core.models.GeoBoundingBox boundingBox, boolean includeText)
      Get Copyright From Bounding Box **Applies to**: S0 and S1 pricing tiers. Returns copyright information for a given bounding box. Bounding-box requests should specify the minimum and maximum longitude and latitude (EPSG-3857) coordinates.
       GeoBoundingBox boundingBox2 = new GeoBoundingBox(52.41064, 4.84228, 52.41072, 4.84239);
       asyncClient.getCopyrightFromBoundingBox(boundingBox2, true).block();
       
      Parameters:
      boundingBox - the GeoBoundingBox for which copyright information is needed.
      includeText - Yes/no value to exclude textual data from response. Only images and country names will be in response.
      Returns:
      this object is returned from a successful copyright request.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getCopyrightFromBoundingBoxWithResponse

      public Mono<com.azure.core.http.rest.Response<Copyright>> getCopyrightFromBoundingBoxWithResponse(com.azure.core.models.GeoBoundingBox boundingBox, boolean includeText)
      Get Copyright From Bounding Box **Applies to**: S0 and S1 pricing tiers. Returns copyright information for a given bounding box. Bounding-box requests should specify the minimum and maximum longitude and latitude (EPSG-3857) coordinates.
       GeoBoundingBox boundingBox2 = new GeoBoundingBox(52.41064, 4.84228, 52.41072, 4.84239);
       asyncClient.getCopyrightFromBoundingBox(boundingBox2, true).block();
       
      Parameters:
      boundingBox - the GeoBoundingBox for which copyright information is needed.
      includeText - Yes/no value to exclude textual data from response. Only images and country names will be in response.
      Returns:
      this object is returned from a successful copyright request.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getCopyrightForTile

      public Mono<Copyright> getCopyrightForTile(TileIndex tileIndex, boolean includeText)
      Get Copyright For Tile **Applies to**: S0 and S1 pricing tiers. Copyrights API is designed to serve copyright information for Render Tile service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries. Returns the copyright information for a given tile. To obtain the copyright information for a particular tile, the request should specify the tile's zoom level and x and y coordinates (see: Zoom Levels and Tile Grid).
       asyncClient.getCopyrightForTile(new TileIndex().setX(9).setY(22).setZ(6), true).block();
       
      Parameters:
      tileIndex - Parameter group.
      includeText - Yes/no value to exclude textual data from response. Only images and country names will be in response.
      Returns:
      this object is returned from a successful copyright request.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getCopyrightForTileWithResponse

      public Mono<com.azure.core.http.rest.Response<Copyright>> getCopyrightForTileWithResponse(TileIndex tileIndex, boolean includeText)
      Get Copyright For Tile **Applies to**: S0 and S1 pricing tiers. Copyrights API is designed to serve copyright information for Render Tile service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries. Returns the copyright information for a given tile. To obtain the copyright information for a particular tile, the request should specify the tile's zoom level and x and y coordinates (see: Zoom Levels and Tile Grid).
       asyncClient.getCopyrightForTile(new TileIndex().setX(9).setY(22).setZ(6), true).block();
       
      Parameters:
      tileIndex - Parameter group.
      includeText - Yes/no value to exclude textual data from response. Only images and country names will be in response.
      Returns:
      this object is returned from a successful copyright request.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getCopyrightForWorld

      public Mono<Copyright> getCopyrightForWorld(boolean includeText)
      Get Copyright For World **Applies to**: S0 and S1 pricing tiers. Copyrights API is designed to serve copyright information for Render Tile service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries. Returns the copyright information for the world. To obtain the default copyright information for the whole world, do not specify a tile or bounding box.
       asyncClient.getCopyrightForWorld(true).block();
       
      Parameters:
      includeText - Yes/no value to exclude textual data from response. Only images and country names will be in response.
      Returns:
      this object is returned from a successful copyright request.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getCopyrightForWorldWithResponse

      public Mono<com.azure.core.http.rest.Response<Copyright>> getCopyrightForWorldWithResponse(boolean includeText)
      Get Copyright For World **Applies to**: S0 and S1 pricing tiers. Copyrights API is designed to serve copyright information for Render Tile service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries. Returns the copyright information for the world. To obtain the default copyright information for the whole world, do not specify a tile or bounding box.
       asyncClient.getCopyrightForWorld(true).block();
       
      Parameters:
      includeText - Yes/no value to exclude textual data from response. Only images and country names will be in response.
      Returns:
      this object is returned from a successful copyright request.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.render.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.