ドキュメント / そのほか / APIリファレンス

APIリファレンス

3 プラットフォームの公開 API を、概念ごとに並べた索引です。ほとんどの型は 3 言語で同じ名前ですが、生成方法(コンストラクタ・ファクトリ・フック)と、一部の型名は言語の作法にあわせて違います。違うところだけを見れば移植できるように並べてあります。

01 · パッケージ

コアに加えて、使う機能のモジュールだけを依存に追加します。プロバイダのモジュール(for-*)は「プロバイダを切り替える」を参照してください。

機能
Android
iOS
React
コア
com.mapconductor:core
MapConductorCore
@mapconductor/js-sdk-core
宣言的コンポーネント
com.mapconductor:compose
コアに同梱
@mapconductor/js-sdk-react
アイコン
com.mapconductor:icons
MapConductorIcons
@mapconductor/react-icons
クラスタリング
com.mapconductor:marker-clustering
MapConductorMarkerCluster
@mapconductor/react-marker-clustering
ヒートマップ
com.mapconductor:heatmap
MapConductorHeatmap
@mapconductor/react-heatmap
GeoJSON
com.mapconductor:geojson
MapConductorGeoJSON
@mapconductor/react-geojson-layer
KML
com.mapconductor:kml

Android はバージョンをまとめて指定できる BOM(com.mapconductor:mapconductor-bom)を公開しています。iOS は Swift Package Manager、React は npm です。

02 · コアの型

概念
Android
iOS
React
座標
GeoPoint
GeoPoint
GeoPoint · createGeoPoint()
矩形範囲
GeoRectBounds
GeoRectBounds
createGeoRectBounds()
カメラ位置
MapCameraPosition
MapCameraPosition
createMapCameraPosition()
地図の状態
MapViewStateInterface<T>
MapViewStateProtocol
MapViewStateInterface<T>
地図デザイン
MapDesignTypeInterface<T>
MapDesignTypeProtocol
MapDesignTypeInterface<T>
出典表記ルール
AttributionRule
AttributionRule
AttributionRule
初期化の段階
InitState
InitState
InitState
ネイティブへの逃げ道
MapViewHolderInterface
AnyMapViewHolder
MapViewHolder
マーカータイル設定
MarkerTilingOptions
MarkerTilingOptions
MarkerTilingOptions

03 · 要素の状態

地図に置くものは、すべて「状態オブジェクトを 1 つ作って地図ビューに渡す」形です。Kotlin・Swift はコンストラクタ、TypeScript は createMarkerState() のようなファクトリを使います。

Android
iOS
React
ページ
MarkerState
MarkerState
createMarkerState()
PolylineState
PolylineState
createPolylineState()
PolygonState
PolygonState
createPolygonState()
CircleState
CircleState
createCircleState()
GroundImageState
GroundImageState
createGroundImageState()
RasterLayerState
RasterLayerState
createRasterLayerState()

どの状態オブジェクトも id・zIndex・clickable・extra・onClick を持ちます。プロパティを書き換えると、地図オブジェクトを作り直さずにその差分だけが反映されます。

04 · コンポーネント

状態オブジェクトを地図ビューの子として宣言するための入れ物です。3 プラットフォームで同じ名前が並びます。Android は MapViewScope の拡張関数、iOS は MapViewContentBuilder の結果ビルダー、React は子コンポーネントとして書きます。

Marker · Markers
1件/複数件のマーカー
Polyline · Polylines
線(iOS は複数形も提供)
Polygon · Polygons
面(穴あきに対応)
Circle · Circles
メートル半径の円
GroundImage · GroundImages
範囲に貼る画像
RasterLayer
タイルのレイヤー
InfoBubble · InfoBubbleCustom
マーカーに紐づく吹き出し。InfoBubbleCustom は枠としっぽを自前で描く低レベル版。
MapAttributionOverlay
出典表記の表示

05 · 関数

Spherical · WGS84Geodesic · Planar
computeDistanceBetween · computeHeading · computeOffset · computeOffsetOrigin · computeLength · computeArea · computeSignedArea · interpolate

球体モデルと楕円体モデルで同じメソッド構成。Planar は緯度経度の直線モデル。

線と範囲のヘルパー
calculateMetersPerPixel · expandBounds · splitByMeridian · closestPointOnSegment · pointOnGeodesicLineOrNull · pointOnLinearLineOrNull

SDK 内部のタップ判定と大圏コース描画が使っているものと同じ関数です。

Earth · WebMercator · WGS84
project · unproject · RADIUS_METERS · FLATTENING · CIRCUMFERENCE_METERS

投影と地球の定数。Android・React が公開しています。

地図ビューの操作
moveCameraTo · fitBounds · getMapViewHolder · mapDesignType

どのプロバイダの状態オブジェクトにも共通で生えています。

関連ページ