Skip to content

Commit

Permalink
maps-render required fields part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
alankashiwa committed Jul 1, 2022
1 parent a8ca43c commit 8f71eb1
Show file tree
Hide file tree
Showing 11 changed files with 126 additions and 72 deletions.
28 changes: 14 additions & 14 deletions sdk/maps/maps-render/review/maps-render.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface Copyright {

// @public
export interface CopyrightCaptionResult {
readonly copyrightsCaption?: string;
readonly copyrightsCaption: string;
readonly formatVersion?: string;
}

Expand All @@ -42,7 +42,7 @@ export interface GetCopyrightCaptionOptions extends OperationOptions {

// @public
export interface GetCopyrightOptions extends OperationOptions {
includeText?: IncludeText;
includeText?: boolean;
}

// @public
Expand Down Expand Up @@ -132,7 +132,7 @@ export enum KnownStaticMapLayer {
}

// @public
export enum KnownTilesetID {
export enum KnownTilesetId {
MicrosoftBase = "microsoft.base",
MicrosoftBaseDarkgrey = "microsoft.base.darkgrey",
MicrosoftBaseHybrid = "microsoft.base.hybrid",
Expand Down Expand Up @@ -172,7 +172,7 @@ export type LocalizedMapView = string;

// @public
export interface MapAttribution {
copyrights?: string[];
copyrights: string[];
}

// @public
Expand All @@ -186,11 +186,11 @@ export class MapsRenderClient {
getCopyrightForTile(tileIndex: TileIndex, options?: GetCopyrightOptions): Promise<Copyright>;
getCopyrightForWorld(options?: GetCopyrightOptions): Promise<Copyright>;
getCopyrightFromBoundingBox(boundingBox: BoundingBox, options?: GetCopyrightOptions): Promise<Copyright>;
getMapAttribution(tilesetId: TilesetID, zoom: number, boundingBox: BoundingBox, options?: GetAttributionOptions): Promise<MapAttribution>;
getMapAttribution(tilesetId: TilesetId, zoom: number, boundingBox: BoundingBox, options?: GetAttributionOptions): Promise<MapAttribution>;
getMapStateTile(statesetId: string, tileIndex: TileIndex, options?: GetMapStateTileOptions): Promise<MapTile>;
getMapStaticImage(format: RasterTileFormat, options?: GetMapStaticImageOptions): Promise<MapTile>;
getMapTile(tilesetId: TilesetID, tileIndex: TileIndex, options?: GetMapTileOptions): Promise<MapTile>;
getMapTileset(tilesetId: TilesetID, options?: GetMapTilesetOptions): Promise<MapTileset>;
getMapTile(tilesetId: TilesetId, tileIndex: TileIndex, options?: GetMapTileOptions): Promise<MapTile>;
getMapTileset(tilesetId: TilesetId, options?: GetMapTilesetOptions): Promise<MapTileset>;
}

// @public
Expand All @@ -217,8 +217,8 @@ export interface MapTileset {
name?: string;
scheme?: string;
template?: string;
tilejson?: string;
tiles?: string[];
tilejson: string;
tiles: string[];
version?: string;
}

Expand All @@ -230,14 +230,14 @@ export type RasterTileFormat = string;

// @public (undocumented)
export interface RegionCopyrights {
readonly copyrights?: string[];
readonly country?: RegionCopyrightsCountry;
readonly copyrights: string[];
readonly country: RegionCopyrightsCountry;
}

// @public
export interface RegionCopyrightsCountry {
readonly iso3?: string;
readonly label?: string;
readonly iso3: string;
readonly label: string;
}

// @public
Expand All @@ -251,7 +251,7 @@ export interface TileIndex {
}

// @public
export type TilesetID = string;
export type TilesetId = string;

// (No @packageDocumentation comment for this package)

Expand Down
8 changes: 4 additions & 4 deletions sdk/maps/maps-render/samples-dev/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import fs from "fs";
import { DefaultAzureCredential } from "@azure/identity";
import { AzureKeyCredential } from "@azure/core-auth";
import { MapsRenderClient, KnownTilesetID, KnownRasterTileFormat } from "@azure/maps-render";
import { MapsRenderClient, KnownTilesetId, KnownRasterTileFormat } from "@azure/maps-render";
import * as dotenv from "dotenv";
dotenv.config();

Expand Down Expand Up @@ -86,20 +86,20 @@ async function main() {

console.log(" --- Get map tile v2:");
const mapTileOptions = { tileSize: "512" };
result = await client.getMapTile(KnownTilesetID.MicrosoftBase, tileIndex, mapTileOptions);
result = await client.getMapTile(KnownTilesetId.MicrosoftBase, tileIndex, mapTileOptions);
// use result.blobBody for Browser, readableStreamBody for Node.js:
result.readableStreamBody &&
result.readableStreamBody.pipe(fs.createWriteStream("tmp/tile_v2.vector.pbf"));

console.log(" --- Get attribution:");
const attribution = await client.getMapAttribution(KnownTilesetID.MicrosoftBase, 6, {
const attribution = await client.getMapAttribution(KnownTilesetId.MicrosoftBase, 6, {
bottomRight: { latitude: 47.57949, longitude: -122.247157 },
topLeft: { latitude: 47.668372, longitude: -122.414162 },
});
console.log(attribution);

console.log(" --- Get tileset metadata:");
const metadata = await client.getMapTileset(KnownTilesetID.MicrosoftBase);
const metadata = await client.getMapTileset(KnownTilesetId.MicrosoftBase);
console.log(metadata);
}

Expand Down
28 changes: 13 additions & 15 deletions sdk/maps/maps-render/src/generated/models/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions sdk/maps/maps-render/src/generated/models/mappers.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions sdk/maps/maps-render/src/generated/operations/renderV2.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8f71eb1

Please sign in to comment.