Skip to content

Commit 9a8ef45

Browse files
authored
Prepare 1.3.0 release (#1)
* test: pin public API surface baseline ドライバー層の共通化中にアプリ開発者向け API を凍結し続けるため、現在の公開 API サーフェスをベースラインとして記録する。生成は親リポジトリの gradle/api-surface.gradle.kts(release AAR の classes.jar を javap で読む)。 ./gradlew :/Users/masashi/mapconductor/android-sdk/android-for-maptilerpiDump ベースラインを更新 ./gradlew :/Users/masashi/mapconductor/android-sdk/android-for-maptilerpiCheck 差分を検出 * refactor: use core WebMercatorZoomAltitudeConverter ズーム換算の式をコアへ移し、このクラスはオフセット 1.0(512px タイルのベクタ エンジン)を指定するだけにする。companion のズーム変換ヘルパーは MapCameraPosition.kt から使われているのでそのまま残した。移行前の値と 320 点すべてで ビット単位一致することをコア側のゴールデンテストで検証済み。 * refactor: move MapTilerViewState onto the core base Step 3 のプロバイダ移行、7 つ目。145 行 -> 116 行。 削ったもの: _cameraPosition / cameraPosition の getter / moveCameraTo x2 / fitBounds / getMapViewHolder の自前実装 このプロバイダ固有の注意点: - コンストラクタの第3引数名は **initialCameraPosition**(他プロバイダは cameraPosition)。公開 API なので変えない。 - setController は接続時にカメラを移動しない。初期カメラは MTMapOptions として 地図生成時に渡しているため。attachController(controller, moveToInitialCamera = false) を使う。 - _cameraPosition は mutableStateOf だったが、基底は素のフィールド。 読み出しは MapTilerMapView の remember ブロック内(監視不要)のみで、 example-app 側もコールバック/ViewModel からしか読んでいないことを確認済み。 先行して移行済みの 6 プロバイダと同じ前提になる。 apiCheck の差分は getCameraPosition / moveCameraTo x2 がこのクラスの宣言から 消えたことのみで、いずれも基底に public で存在し継承で解決されるため互換。 * fix: keep the optimistic camera update after moving onto the core base 基底へ移した際に optimisticCameraUpdate の指定が漏れていた。移行前は moveCameraTo がコントローラへ委譲する前に _cameraPosition を要求値で更新して おり、WebView ブリッジ越しでカメライベントの往復が遅いこのプロバイダでは、 要求直後に cameraPosition を読むと古い値が返ってしまう。 基底に足した optimisticCameraUpdate = true を渡して元の挙動へ戻す。 * refactor: drop the Capable facade delegations in favour of the core defaults compositionXxx / updateXxx / hasXxx のうち、登録済みコントローラへ 1 行転送 しているだけのものを削除する。BaseMapViewController の既定実装が OverlayKind で振り分けて同じことをする。 追加処理が要るもの(MapLibre / Mapbox の polygon は z レイヤの再構築が要る)は override したまま残している。 apiCheck の差分は基底へ移って継承される宣言のみ。 * refactor: use the core click cascade タップの扱いを他プロバイダと揃える。従来は地図クリックを**先に無条件で**通知し、 そのうえでポリライン・ポリゴン・円の**すべて**に配送していた(早期 return が無い)。 そのためオーバーレイをタップすると onMapClick とオーバーレイの onClick が 両方飛んでいた。いまは marker -> circle -> groundImage -> polyline -> polygon -> map の順で先に当たった 1 つだけ。グラウンドイメージが探索対象に入るのも今回から。 handleTap は公開済みの入口なので残し、中身をコアの dispatchOverlayTap に置き換えて 非推奨にする。handleMarkerTap は消費したかを返すようになり、clickable=false の マーカーを透過させる。 実機確認: polygon-click で Inside、circle でトースト、polyline-click で線上の 最近傍点、marker-postoffice で情報ウィンドウ。 * test: update the API baseline for the marker drag hooks MarkerOverlayRendererInterface に既定つきで onDragSelectionChanged / onDragPositionChanged が増えたので、実装クラスにも既定実装が生える。 このプロバイダはドラッグ層を持たないので実装は空(コアの既定)。 * Prepare 1.3.0 release - Bump `libraryVersion` to 1.3.0 - Point README docs links at the consolidated mapconductor.com site (`docs-android.mapconductor.com` is being retired) - Fill in the LICENSE copyright line (2026)
1 parent 629df0a commit 9a8ef45

12 files changed

Lines changed: 987 additions & 287 deletions

.github/workflows/publish-maven-central.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
6060
GROUP_ID="com.mapconductor"
6161
GROUP_PATH="${GROUP_ID//./\/}"
62-
ARTIFACT_ID="for-maplibre"
62+
ARTIFACT_ID="for-maptiler"
6363
6464
local_version=$(grep '^libraryVersion=' gradle.properties | cut -d'=' -f2 | tr -d '\r')
6565
if [[ -z "$local_version" ]]; then

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright 2026 Masashi Katsumata
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ This module wraps the official [`com.maptiler:maptiler-sdk-kotlin`](https://docs
1212

1313
## Setup
1414

15+
https://mapconductor.com/setup/android/maptiler/
16+
1517
Add your MapTiler Cloud API key. This module reads it from an
1618
`AndroidManifest.xml` `<meta-data>` entry (injected by the Secrets Gradle Plugin from
1719
`secrets.properties`):
@@ -46,6 +48,197 @@ fun MapView(modifier: Modifier = Modifier) {
4648
}
4749
```
4850

51+
## Components
52+
53+
### MapTilerMapView [[docs]](https://mapconductor.com/mapview/)
54+
55+
```kotlin
56+
@Composable
57+
fun MapExample() {
58+
val initCameraPosition = MapCameraPosition(
59+
position = GeoPoint(
60+
latitude = 34.091,
61+
longitude = -117.886,
62+
),
63+
zoom = 9.0,
64+
tilt = 60.0,
65+
bearing = 30.0,
66+
)
67+
68+
val mapViewState = rememberMapTilerMapViewState(
69+
cameraPosition = initCameraPosition,
70+
)
71+
72+
MapTilerMapView(mapViewState)
73+
}
74+
```
75+
76+
------------------------------------------------------------------------
77+
78+
### Marker [[docs]](https://mapconductor.com/markers/)
79+
80+
```kotlin
81+
@Composable
82+
fun MarkerExample() {
83+
val markerState = remember { MarkerState(
84+
position = GeoPoint(...),
85+
icon = DefaultMarkerIcon().copy(
86+
label = "MapTiler",
87+
),
88+
onClick = {
89+
it.animate(MarkerAnimation.Bounce)
90+
},
91+
) }
92+
93+
MapTilerMapView(...) {
94+
Marker(markerState)
95+
}
96+
}
97+
```
98+
99+
------------------------------------------------------------------------
100+
101+
### InfoBubble [[docs]](https://mapconductor.com/info-bubble/)
102+
103+
```kotlin
104+
@Composable
105+
fun InfoBubbleExample() {
106+
var selectedMarker by remember { mutableStateOf<MarkerState?>(null) }
107+
108+
val markerState = remember { MarkerState(
109+
...,
110+
onClick = {
111+
selectedMarker = it
112+
},
113+
) }
114+
115+
MapTilerMapView(...) {
116+
Marker(markerState)
117+
selectedMarker?.let {
118+
InfoBubble(
119+
marker = it,
120+
) {
121+
Text("Hello, world!")
122+
}
123+
}
124+
}
125+
}
126+
```
127+
128+
------------------------------------------------------------------------
129+
130+
### Circle [[docs]](https://mapconductor.com/circle/)
131+
132+
```kotlin
133+
@Composable
134+
fun CircleExample() {
135+
136+
val circleState = remember { CircleState(
137+
center = GeoPoint(...),
138+
radiusMeters = 50.0,
139+
fillColor = Color.Blue.copy(alpha = 0.5f),
140+
onClick = {
141+
it.state.fillColor = Color.Red.copy(alpha = 0.5f)
142+
}
143+
) }
144+
145+
MapTilerMapView(...) {
146+
Circle(circleState)
147+
}
148+
}
149+
```
150+
151+
------------------------------------------------------------------------
152+
153+
### Polyline [[docs]](https://mapconductor.com/polyline/)
154+
155+
```kotlin
156+
@Composable
157+
fun PolylineExample() {
158+
159+
val polylineState = remember { PolylineState(
160+
points = airports,
161+
strokeColor = Color.Blue.copy(alpha = 0.5f),
162+
strokeWidth = 4.dp,
163+
geodesic = true,
164+
) }
165+
166+
MapTilerMapView(...) {
167+
Polyline(polylineState)
168+
}
169+
}
170+
```
171+
172+
------------------------------------------------------------------------
173+
174+
### Polygon [[docs]](https://mapconductor.com/polygon/)
175+
176+
```kotlin
177+
@Composable
178+
fun PolygonExample() {
179+
180+
val polygonState = remember { PolygonState(
181+
points = goryokaku,
182+
strokeColor = Color.Blue.copy(alpha = 0.5f),
183+
fillColor = Color.Red.copy(alpha = 0.7f),
184+
) }
185+
186+
MapTilerMapView(...) {
187+
Polygon(polygonState)
188+
}
189+
}
190+
```
191+
192+
------------------------------------------------------------------------
193+
194+
### Polygon Hole
195+
196+
```kotlin
197+
@Composable
198+
fun PolygonHoleExample() {
199+
200+
val polygonState =
201+
remember {
202+
PolygonState(
203+
points = listOf(...),
204+
holes = listOf(
205+
listOf(...),
206+
listOf(...),
207+
),
208+
fillColor = Color(0xCC787880),
209+
strokeColor = Color.Red,
210+
strokeWidth = 2.dp,
211+
)
212+
}
213+
214+
MapTilerMapView(...) {
215+
Polygon(polygonState)
216+
}
217+
}
218+
```
219+
220+
------------------------------------------------------------------------
221+
222+
### GroundImage [[docs]](https://mapconductor.com/ground-image/)
223+
224+
```kotlin
225+
@Composable
226+
fun GroundImageExample() {
227+
val groundImageState = remember { GroundImageState(
228+
bounds = GeoRectBounds(
229+
southWest = GeoPoint.fromLatLong(...),
230+
northEast = GeoPoint.fromLatLong(...),
231+
),
232+
image = image,
233+
opacity = 0.5f,
234+
) }
235+
236+
MapTilerMapView(state = mapViewState) {
237+
GroundImage(groundImageState)
238+
}
239+
}
240+
```
241+
49242
## Available designs
50243

51244
`MapTilerDesign` exposes MapTiler Cloud reference styles and variants, including:

0 commit comments

Comments
 (0)