Class: MaprayApi

mapray~ MaprayApi

このクラスを利用するには事前にMapray Cloudアカウントを作成する必要があります。 https://cloud.mapray.comからサインアップすることができます。

事前に下記の情報を調べておきます。

User ID
Mapray Cloudのユーザー情報ページから確認します。 右上メニューのAccountメニューからこのページを開くことができます。
Token
Mapray CloudのTokenページでトークンを作成します。 上部のTokensタブからこのページを開くことができます。
データセット等のID
Mapray Cloudへデータをアップロードし、そのデータを使用するには、データセットページ からGeoJsonやglTFデータをアップロードしておき、表中のIDを確認します。

new MaprayApi(option)

Mapray Cloudへアクセスするためのクラスです。

Parameters:
Name Type Description
option object
Properties
Name Type Argument Default Description
basePath string <optional>
https://cloud.mapray.com

Mapray CloudのURLを指定します。通常は省略します。

version string

Mapray Cloud の APIバージョン "v1" のように指定します。

userId string

Mapray Cloud アカウントの User ID を指定します。

token string

Mapray Cloud で生成した Token を指定します。

Source:
Example
const maprayApi = new mapray.MaprayApi({
        basePath: "https://api.mapray.com",
        version: "v1",
        userId: "...",
        token: "..."
});
const datasets = await maprayApi.getDatasets();
...

Methods


<async> create3DDataset(name, description, option)

3D datastを作成します。

Parameters:
Name Type Description
name string

名前

description string

説明

option object
Properties
Name Type Description
path string

glTFファイルのパスを指定します(アップロードする際はディレクトリを指定するため、ディレクトリルートからのglTFファイルへのパスを指定します)

format string

"glTF"を指定します

srid string

現在は4326(WGS 84)を指定します

x number

経度

y number

緯度

z number

高さ

Source:
Returns:

json

Type
object

<async> create3DDatasetUploadUrl(datasetId)

3Dデータセットアップロード用URLを取得します。

Parameters:
Name Type Description
datasetId string

データセットId

Source:
Returns:

json

Type
object

<async> createDataset(name, description)

データセットを作成します。

Parameters:
Name Type Description
name string

名前

description string

説明

Source:
Returns:
Type
object

<async> delete3DDataset(datasetId)

3Dデータセットを削除します。

Parameters:
Name Type Description
datasetId string

データセットId

Source:
Returns:

json

Type
object

<async> deleteDataset()

データセットを削除します。

Source:
Returns:

json

Type
object

<async> get3DDataset(datasetId)

3Dデータセット情報を取得します。
データセットが保持するデータにアクセスするには、get3DDatasetScene()を利用します。

Parameters:
Name Type Description
datasetId string

データセットId

Source:
Returns:

json

Type
object

get3DDatasetAsResource(datasetId)

指定したIDの3Dデータセットのシーンファイルをリソースとして取得します。

Parameters:
Name Type Description
datasetId Array.<string>

データセットIDのリスト

Source:
Returns:
Type
Resource

<async> get3DDatasets( [page] [, limit])

3Dデータセットのリストを取得します。

Parameters:
Name Type Argument Default Description
page number <optional>
1

取得する要素のページ番号

limit number <optional>
5

1ページに含まれる要素数。最大100まで指定することができます。

Source:
Returns:

json

Type
object

<async> get3DDatasetScene(datasetIds)

3Dデータセットに含まれる scene情報 を取得します。

Parameters:
Name Type Description
datasetIds string | Array.<string>
Source:
Returns:

シーンファイルの実体

Type
object

<async> getDataset(datasetId)

get dataset

Parameters:
Name Type Description
datasetId string
Source:
Returns:

json

Type
object

getDatasetAsResource(datasetId)

指定したIDのデータセットをリソースとして取得します。

Parameters:
Name Type Description
datasetId string

データセットID

Source:
Returns:
Type
Resource

<async> getDatasets( [page] [, limit])

データセットリストを取得します

Parameters:
Name Type Argument Default Description
page number <optional>
1

取得する要素のページ番号

limit number <optional>
5

1ページに含まれる要素数。最大100まで指定することができます。

Source:
Returns:

json

Type
object

<async> getFeatures(datasetId)

GeoJSONの内容を取得します。

Parameters:
Name Type Description
datasetId string

データセットID

Source:
Returns:

json

Type
object

<async> getPointCloudDataset(datasetId)

点群データセットを取得します。

Parameters:
Name Type Description
datasetId string

データセットId

Source:
Returns:

json

Type
object

getPointCloudDatasetAsResource(datasetId)

指定したIDの点群データセットの定義ファイルをリソースとして取得します。

Parameters:
Name Type Description
datasetId string

データセットID

Source:
Returns:
Type
Resource

<async> getPointCloudDatasets( [page] [, limit])

点群データセットリストを取得します。

Parameters:
Name Type Argument Default Description
page number <optional>
1

取得する要素のページ番号

limit number <optional>
5

1ページに含まれる要素数。最大100まで指定することができます。

Source:
Returns:

json

Type
object

<async> insertFeature(datasetId)

GeoJSON要素をアップロード(挿入)します。

Parameters:
Name Type Description
datasetId string

データセットID

Source:
Returns:

json

Type
object

<async> load3DDataset(datasetId)

指定したIDの3Dデータセットを取得します。

Parameters:
Name Type Description
datasetId string
Source:
Returns:
Type
Dataset3D

<async> load3DDatasets( [page] [, limit])

3Dデータセットのリストを取得します。
ページごとにデータセットリストを取得します。

Parameters:
Name Type Argument Default Description
page number <optional>
1

取得する要素のページ番号

limit number <optional>
5

1ページに含まれる要素数。最大100まで指定することができます。

Source:
Returns:
Type
Array.<Dataset3D>

<async> loadDataset(datasetId)

指定したIDのデータセットを取得します。

Parameters:
Name Type Description
datasetId string

データセットのID

Source:
Returns:
Type
Dataset

<async> loadDatasets( [page] [, limit])

データセットのリストを取得します。
ページごとにデータセットリストを取得します。

Parameters:
Name Type Argument Default Description
page number <optional>
1

取得する要素のページ番号

limit number <optional>
5

1ページに含まれる要素数。最大100まで指定することができます。

Source:
Returns:
Type
Array.<Dataset>

<async> loadPointCloudDataset(datasetId)

指定したIDの点群データセットを取得します。

Parameters:
Name Type Description
datasetId string

データセットID

Source:
Returns:
Type
PointCloudDataset

<async> loadPointCloudDatasets( [page] [, limit])

点群データセットのリストを取得します。
ページごとにデータセットリストを取得します。

Parameters:
Name Type Argument Default Description
page number <optional>
1

取得する要素のページ番号

limit number <optional>
5

1ページに含まれる要素数。最大100まで指定することができます。

Source:
Returns:
Type
Array.<PointCloudDataset>

<async> update3DDataset(datasetId, name, description, option)

3Dデータセットを更新します。

Parameters:
Name Type Description
datasetId string

データセットId

name string

名前

description string

説明

option object
Properties
Name Type Description
path string

glTFファイルのパスを指定します(アップロードする際はディレクトリを指定するため、ディレクトリルートからのglTFファイルへのパスを指定します)

format string

"glTF"を指定します

srid string

現在は4326(WGS 84)を指定します

x number

経度

y number

緯度

z number

高さ

Source:
Returns:

json

Type
object

<async> updateFeature(datasetId, featureId, feature)

GeoJSON要素を更新(上書き)します。

Parameters:
Name Type Description
datasetId string

データセットID

featureId string

GeoJSON要素ID

feature object

GeoJSON要素

Source:
Returns:

json

Type
object