Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@
"Bash(xcodebuild -scheme \"ios-sdk-core\" -destination \"generic/platform=iOS Simulator\" build)",
"Bash(xcodebuild -list)",
"Bash(xcodebuild -scheme MapConductorSampleApp -destination \"generic/platform=iOS Simulator\" build)",
"Bash(xcodebuild -workspace MapConductorSampleApp.xcworkspace -scheme MapConductorSampleApp -destination 'generic/platform=iOS Simulator' build)"
"Bash(xcodebuild -workspace MapConductorSampleApp.xcworkspace -scheme MapConductorSampleApp -destination 'generic/platform=iOS Simulator' build)",
"Bash(git -C /Users/masashi/android-sdk/android-geojson-layer log --oneline bfa194c07a..e75c70bae)",
"Bash(git -C /Users/masashi/android-sdk/android-geojson-layer log --oneline e75c70bae..bfa194c07a)",
"Bash(git *)"
],
"deny": [],
"ask": []
Expand Down
2 changes: 1 addition & 1 deletion android-for-arcgis
2 changes: 1 addition & 1 deletion android-for-googlemaps
2 changes: 1 addition & 1 deletion android-for-here
2 changes: 1 addition & 1 deletion android-for-mapbox
2 changes: 1 addition & 1 deletion android-heatmap
2 changes: 1 addition & 1 deletion android-sdk-core
29 changes: 12 additions & 17 deletions docs/astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ export default defineConfig({
integrations: [
postBuildIntegration(),
starlight({
title: {
en: "MapConductor — a unified Android maps SDK that lets you work with multiple map providers through a single API",
ja: "MapConductor(マップコンダクター) ♪ 複数の地図プロバイダを単一のAPIで扱えるAndroid向け統一地図SDK",
"es-419": "MapConductor — Un SDK de mapas unificado para Android que ofrece una API común para múltiples proveedores de mapas",
},
title: "MapConductor",
markdown: {
headingLinks: false,
},
Expand Down Expand Up @@ -114,18 +110,15 @@ export default defineConfig({
{ slug: 'states/groundimage-state' },
],
},
// {
// label: 'Events',
// translations: {
// ja: 'イベント',
// },
// items: [
// { slug: 'event/onMapLoaded' },
// // { slug: 'event/onCameraMoveStart' },
// // { slug: 'event/onCameraMove' },
// // { slug: 'event/onCameraMoveEnd' },
// ],
// },
{
label: 'Events',
translations: {
ja: 'イベント',
},
items: [
{ slug: 'event/event-handlers' },
],
},
{
label: 'MapViewHolder',
items: [
Expand All @@ -134,6 +127,7 @@ export default defineConfig({
{ slug: 'mapviewholder/mapbox' },
{ slug: 'mapviewholder/here-maps' },
{ slug: 'mapviewholder/arcgis' },
{ slug: 'mapviewholder/arcgis-2d' },
{ slug: 'mapviewholder/maplibre' },
],
},
Expand Down Expand Up @@ -163,6 +157,7 @@ export default defineConfig({
ja: '実験的機能',
},
items: [
{ slug: 'experimental/geojson-layer' },
{ slug: 'experimental/heatmap' },
{ slug: 'experimental/marker-clustering' },
{ slug: 'experimental/icons' },
Expand Down
68 changes: 68 additions & 0 deletions docs/scripts/translate-specific.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import fs from 'node:fs/promises';
import path from 'node:path';
import OpenAI from 'openai';

const JA_ROOT = path.join('src', 'content', 'docs', 'ja');
const EN_ROOT = path.join('src', 'content', 'docs');
const ES_ROOT = path.join('src', 'content', 'docs', 'es-419');

const FILES = [
'event/event-handlers.mdx',
'components/infobubble.mdx',
'core/mapcameraposition.mdx',
'experimental/geojson-layer.mdx',
'mapviewholder/arcgis-2d.mdx',
];

const apiKey = process.env.OPENAI_API_KEY;
if (!apiKey) { console.error('OPENAI_API_KEY not set'); process.exit(1); }
const model = process.env.DOCS_TRANSLATION_MODEL || 'gpt-4.1-mini';
const client = new OpenAI({ apiKey });

async function translate(content, lang, filePath) {
const langName = lang === 'en' ? 'English' : 'Latin American Spanish';
const res = await client.chat.completions.create({
model,
temperature: 0.2,
messages: [
{
role: 'system',
content:
'You are a professional technical translator for developer documentation. ' +
'Translate Japanese Markdown/MDX documentation into the target language. ' +
'Preserve all Markdown/MDX syntax, code blocks, inline code, links, and frontmatter keys. ' +
'Translate human-readable text and frontmatter string values, but do not change file structure.',
},
{
role: 'user',
content:
`Translate the following Japanese documentation into ${langName}.\n` +
'Keep the overall structure and formatting exactly the same.\n\n' +
'--- BEGIN FILE ---\n' + content + '\n--- END FILE ---\n',
},
],
});
const translated = res.choices[0]?.message?.content?.trim();
if (!translated) throw new Error(`Empty translation for ${filePath} (${lang})`);
return translated;
}

for (const rel of FILES) {
const jaPath = path.join(JA_ROOT, rel);
const enPath = path.join(EN_ROOT, rel);
const esPath = path.join(ES_ROOT, rel);

const jaContent = await fs.readFile(jaPath, 'utf8');

console.log(`[EN] ${rel}`);
const enContent = await translate(jaContent, 'en', rel);
await fs.mkdir(path.dirname(enPath), { recursive: true });
await fs.writeFile(enPath, enContent, 'utf8');

console.log(`[ES] ${rel}`);
const esContent = await translate(jaContent, 'es-419', rel);
await fs.mkdir(path.dirname(esPath), { recursive: true });
await fs.writeFile(esPath, esContent, 'utf8');
}

console.log('Done.');
Binary file modified docs/src/assets/introduction/basic-googlemaps-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/assets/introduction/basic-mapbox-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const code = `MapView(
...,
onMapLoaded: OnMapLoadedHandler? = null,
onMapClick: OnMapEventHandler? = null,
onMapLongClick: OnMapEventHandler? = null,
onCameraMoveStart: OnCameraMoveHandler? = null,
onCameraMove: OnCameraMoveHandler? = null,
onCameraMoveEnd: OnCameraMoveHandler? = null,
Expand Down
21 changes: 21 additions & 0 deletions docs/src/components/api/event-handlers/OnMapLongClickExample.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
import { Code } from '@astrojs/starlight/components';

interface Props {
commentForPrint?: string;
}

const {
commentForPrint = "Map long-clicked at:"
} = Astro.props;

const code = `MapView(
onMapLongClick = { geoPoint ->
println("${commentForPrint} \${geoPoint.latitude}, \${geoPoint.longitude}")
}
) {
// ...
}`;
---

<Code code={code} lang="kotlin" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
import { Code } from '@astrojs/starlight/components';

const code = `onMapLongClick: OnMapEventHandler? = null`;
---

<Code code={code} lang="kotlin" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
import { Code } from '@astrojs/starlight/components';

const code = `val state = rememberArcGISMapViewState(
mapDesign = ArcGISDesign.Streets,
cameraPosition = MapCameraPosition(
position = GeoPoint(35.68, 139.76),
zoom = 12.0,
)
)

ArcGISMapView2D(
state = state,
modifier = Modifier.fillMaxSize(),
onMapLoaded = {
println("2D マップ読み込み完了")
},
onMapClick = { geoPoint ->
println("タップ: \${geoPoint.latitude}, \${geoPoint.longitude}")
}
) {
// マーカーや他のオーバーレイを配置できます
}`;
---

<Code code={code} lang="kotlin" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
import { Code } from '@astrojs/starlight/components';

const code = `@Composable
fun ArcGISMapView2D(
state: ArcGISMapViewState,
modifier: Modifier = Modifier,
markerTiling: MarkerTilingOptions? = null,
sdkInitialize: (suspend (android.content.Context) -> Boolean)? = null,
onMapLoaded: OnMapLoadedHandler? = null,
onCameraMoveStart: OnCameraMoveHandler? = null,
onCameraMove: OnCameraMoveHandler? = null,
onCameraMoveEnd: OnCameraMoveHandler? = null,
onMapClick: OnMapEventHandler? = null,
onMapLongClick: OnMapEventHandler? = null,
content: (@Composable ArcGISMapViewScope.() -> Unit)? = null,
)`;
---

<Code code={code} lang="kotlin" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
import { Code } from '@astrojs/starlight/components';

const code = `// 3D ビュー(デフォルト ArcGISMapView)
ArcGISMapView(
state = state,
modifier = Modifier.fillMaxSize(),
) { }

// 2D フラットビュー(ArcGISMapView2D)
ArcGISMapView2D(
state = state,
modifier = Modifier.fillMaxSize(),
) { }`;
---

<Code code={code} lang="kotlin" />
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fun InteractiveCircleExample() {
val edgeMarkerState = MarkerState(
id = "edge_marker",
position = edgeMarkerPosition,
icon = DefaultIcon(
icon = ColorDefaultIcon(
fillColor = Color.Green,
strokeColor = Color.White,
label = "Drag me",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fun DynamicCircleExample() {
// Center marker
Marker(
position = GeoPoint.fromLatLong(37.7749, -122.4194),
icon = DefaultIcon(
icon = ColorDefaultIcon(
fillColor = circleColor,
label = "${'${'}circleRadius.toInt()}m"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fun InteractiveCircleExample() {

val centerMarker = MarkerState(
position = centerPosition,
icon = DefaultIcon(
icon = ColorDefaultIcon(
fillColor = Color.Blue,
label = "C"
),
Expand All @@ -51,7 +51,7 @@ fun InteractiveCircleExample() {

val edgeMarker = MarkerState(
position = edgePosition,
icon = DefaultIcon(
icon = ColorDefaultIcon(
fillColor = Color.Green,
label = "E"
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ fun DynamicGroundImageExample() {

Marker(
position = bounds.southwest,
icon = DefaultIcon(fillColor = Color.Green, label = "SW", scale = 0.6f)
icon = ColorDefaultIcon(fillColor = Color.Green, label = "SW", scale = 0.6f)
)
Marker(
position = bounds.northeast,
icon = DefaultIcon(fillColor = Color.Red, label = "NE", scale = 0.6f)
icon = ColorDefaultIcon(fillColor = Color.Red, label = "NE", scale = 0.6f)
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const {
const code = `// ${commentForBottomAnchorIntro}
val markerWithBottomAnchor = MarkerState(
position = position,
icon = ImageDefaultIcon(
icon = ImageColorDefaultIcon(
drawable = customIcon,
anchor = Offset(${bottomAnchorX}f, ${bottomAnchorY}f) // ${commentForBottomAnchorAnchor}
)
Expand All @@ -35,7 +35,7 @@ val markerWithBottomAnchor = MarkerState(
// ${commentForCenterAnchorIntro}
val markerWithCenterAnchor = MarkerState(
position = position,
icon = ImageDefaultIcon(
icon = ImageColorDefaultIcon(
drawable = customIcon,
anchor = Offset(${centerAnchorX}f, ${centerAnchorY}f) // ${commentForCenterAnchorAnchor}
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
import { Code } from '@astrojs/starlight/components';

interface Props {
commentForTailOffset?: string;
commentForMarker?: string;
}

const {
commentForTailOffset = "右側中央を接続点にする",
commentForMarker = "マーカー"
} = Astro.props;

const code = `InfoBubbleCustom(
marker = markerState, // ${commentForMarker}
tailOffset = Offset(1f, 0.5f), // ${commentForTailOffset}
) {
// カスタム形状の吹き出しを描画
Box(
modifier = Modifier
.background(Color.Yellow, RoundedCornerShape(8.dp))
.padding(8.dp)
) {
Text("カスタムバブル")
}
}`;
---

<Code code={code} lang="kotlin" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
import { Code } from '@astrojs/starlight/components';

const code = `@Composable
fun MapViewScope.InfoBubbleCustom(
marker: MarkerState,
tailOffset: Offset,
content: @Composable () -> Unit,
)`;
---

<Code code={code} lang="kotlin" />
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fun InteractiveBubbleExample(modifier: Modifier = Modifier) {

val markerState = MarkerState(
position = GeoPoint.fromLatLong(${markerLatitude}, ${markerLongitude}),
icon = DefaultIcon(fillColor = Color(${markerColor}), label = "${markerLabel}"),
icon = ColorDefaultIcon(fillColor = Color(${markerColor}), label = "${markerLabel}"),
extra = storeInfo,
id = "${markerId}",
onClick = onMarkerClick
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fun MultipleBubblesExample() {
MarkerState(
id = "marker_\$index",
position = position,
icon = DefaultIcon(fillColor = color, label = "\${index + 1}"),
icon = ColorDefaultIcon(fillColor = color, label = "\${index + 1}"),
extra = name,
onClick = onMarkerClick
)
Expand Down
Loading
Loading