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
4 changes: 2 additions & 2 deletions README.es-419.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Con MapConductor puedes:
* Construir funciones de mapas independientes del proveedor, como mapas de calor y agrupamiento de marcadores
* Mantener tu código de aplicación enfocado en el comportamiento del mapa, no en las diferencias específicas de cada SDK

![](./images/es-419-comic-why-map-conductor.jpg)
![](./docs/src/assets/top-page/es-419-comic-why-map-conductor.jpg)

---

Expand Down Expand Up @@ -160,7 +160,7 @@ fun SimpleMapScreen(modifier: Modifier) {

Este ejemplo usa MapLibre Maps, pero los objetos del mapa están escritos usando conceptos de MapConductor. La misma lógica de superposiciones se puede adaptar a otros proveedores compatibles.

![](./images/simple-map-screen.png)
![](./docs/src/assets/top-page/simple-map-screen.png)

---

Expand Down
4 changes: 2 additions & 2 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ MapConductorを使うと、以下のことができます:
* プロバイダーに依存しないヒートマップやマーカークラスタリングなどのマップ機能を構築する
* アプリケーションコードをSDK固有の差異ではなくマップの挙動に集中させる

![](./images/japanese-comic-why-map-conductor.jpg)
![](./docs/src/assets/top-page/japanese-comic-why-map-conductor.jpg)

---

Expand Down Expand Up @@ -160,7 +160,7 @@ fun SimpleMapScreen(modifier: Modifier) {

この例ではMapLibre Mapsを使用していますが、マップオブジェクトはMapConductorの概念を使って書かれています。同じオーバーレイのロジックを他のサポートされているプロバイダーに適用できます。

![](./images/simple-map-screen.png)
![](./docs/src/assets/top-page/simple-map-screen.png)

---

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ With MapConductor, you can:
* Build provider-independent map features such as heatmaps and marker clustering
* Keep your application code focused on map behavior, not SDK-specific differences

![](./images/english-comic-why-map-conductor.jpg)
![](./docs/src/assets/top-page/english-comic-why-map-conductor.jpg)

---

Expand Down Expand Up @@ -160,7 +160,7 @@ fun SimpleMapScreen(modifier: Modifier) {

This example uses MapLibre Maps, but the map objects are written using MapConductor concepts. The same overlay logic can be adapted to other supported providers.

![](./images/simple-map-screen.png)
![](./docs/src/assets/top-page/simple-map-screen.png)

---

Expand Down
2 changes: 1 addition & 1 deletion android-heatmap
2 changes: 1 addition & 1 deletion android-icons
24 changes: 24 additions & 0 deletions docs/src/content/docs/core/georectbounds.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,27 @@ The bounds can be dynamically extended to include new points:
### Equality Comparison

<EqualsToExample commentForUsage="Usage" />

## Fitting the Camera to Bounds

To move and zoom the camera so a `GeoRectBounds` is fully visible, use `fitBounds`:

```kotlin
val bounds = GeoRectBounds(
southWest = GeoPoint.fromLatLong(37.7649, -122.4294),
northEast = GeoPoint.fromLatLong(37.7849, -122.4094)
)
mapViewState.fitBounds(bounds, padding = 32)
```

The `padding` parameter adds screen-space inset in pixels on all sides. Each provider calculates the resulting zoom level natively, so the exact zoom may differ slightly between providers.

A common pattern is to build bounds from a set of points and then fit:

```kotlin
val bounds = GeoRectBounds()
markers.forEach { bounds.extend(it.position) }
if (!bounds.isEmpty) {
mapViewState.fitBounds(bounds, padding = 48)
}
```
30 changes: 30 additions & 0 deletions docs/src/content/docs/core/mapcameraposition.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,33 @@ The visible region describes the actual geographic area displayed on screen afte
<source src="/mapcameraposition/camera-control-example.webm" type="video/webm" />
<source src="/mapcameraposition/camera-control-example.mp4" type="video/mp4" />
</video>

## Fitting Bounds

Use `fitBounds` to move and zoom the camera so that a `GeoRectBounds` is fully visible:

```kotlin
val bounds = GeoRectBounds(
southWest = GeoPoint.fromLatLong(37.7649, -122.4294),
northEast = GeoPoint.fromLatLong(37.7849, -122.4094)
)
mapViewState.fitBounds(bounds, padding = 32)
```

The `padding` parameter adds screen-space inset in pixels on all sides. Each provider calculates the resulting zoom level natively.

### Showing Multiple Points

To frame a set of markers or route points, extend a bounds and then fit:

<ShowMultiplePointsExample commentForZoomCalculation="Use fitBounds instead of manual zoom calculation" />

The `fitBounds` call replaces the manual zoom calculation shown above:

```kotlin
val bounds = GeoRectBounds()
allPoints.forEach { bounds.extend(it) }
if (!bounds.isEmpty) {
mapViewState.fitBounds(bounds, padding = 48)
}
```
24 changes: 24 additions & 0 deletions docs/src/content/docs/es-419/core/georectbounds.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,27 @@ import EqualsToExample from '~/components/core/georectbounds/EqualsToExample.ast
### Comparación de igualdad

<EqualsToExample commentForUsage="Uso" />

## Ajustar la cámara a los límites

Para mover y hacer zoom de la cámara de modo que un `GeoRectBounds` sea completamente visible, usa `fitBounds`:

```kotlin
val bounds = GeoRectBounds(
southWest = GeoPoint.fromLatLong(37.7649, -122.4294),
northEast = GeoPoint.fromLatLong(37.7849, -122.4094)
)
mapViewState.fitBounds(bounds, padding = 32)
```

El parámetro `padding` agrega un margen en píxeles en todos los lados del espacio de pantalla. Cada proveedor calcula el nivel de zoom resultante de forma nativa, por lo que el zoom exacto puede diferir ligeramente entre proveedores.

Un patrón común es construir límites desde un conjunto de puntos y luego ajustar:

```kotlin
val bounds = GeoRectBounds()
markers.forEach { bounds.extend(it.position) }
if (!bounds.isEmpty) {
mapViewState.fitBounds(bounds, padding = 48)
}
```
30 changes: 30 additions & 0 deletions docs/src/content/docs/es-419/core/mapcameraposition.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,33 @@ La región visible describe el área geográfica real que se muestra en pantalla
<source src="/mapcameraposition/camera-control-example.webm" type="video/webm" />
<source src="/mapcameraposition/camera-control-example.mp4" type="video/mp4" />
</video>

## Ajustar a límites

Usa `fitBounds` para mover y hacer zoom de la cámara de modo que un `GeoRectBounds` sea completamente visible:

```kotlin
val bounds = GeoRectBounds(
southWest = GeoPoint.fromLatLong(37.7649, -122.4294),
northEast = GeoPoint.fromLatLong(37.7849, -122.4094)
)
mapViewState.fitBounds(bounds, padding = 32)
```

El parámetro `padding` agrega un margen en píxeles en todos los lados del espacio de pantalla. Cada proveedor calcula el nivel de zoom resultante de forma nativa.

### Mostrar múltiples puntos

Para encuadrar un conjunto de marcadores o puntos de ruta, extiende los límites y luego ajusta:

<ShowMultiplePointsExample commentForZoomCalculation="Usa fitBounds en lugar del cálculo manual de zoom" />

La llamada a `fitBounds` reemplaza el cálculo manual de zoom mostrado arriba:

```kotlin
val bounds = GeoRectBounds()
allPoints.forEach { bounds.extend(it) }
if (!bounds.isEmpty) {
mapViewState.fitBounds(bounds, padding = 48)
}
```
2 changes: 1 addition & 1 deletion docs/src/content/docs/es-419/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ lastUpdated: false

import { CardGrid, Card } from "@astrojs/starlight/components";
import { Image } from "astro:assets";
import topBanner from "~/assets/top-banner.png";
import topBanner from "~/assets/top-page/es-419-comic-why-map-conductor.jpg";
import QuickExampleTabs from "~/components/index/QuickExampleTabs.astro";
import Features from "~/components/index/Features.astro";
import MapConductorIntroduction from "~/components/index/MapConductorIntroduction.astro";
Expand Down
11 changes: 11 additions & 0 deletions docs/src/content/docs/es-419/modules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ Overlay de mapa de calor independiente de la implementación:

Funciona con cualquier proveedor de mapas mediante una capa raster basada en tiles. Ver [Heatmap](/es-419/experimental/heatmap/).

### `android-geojson-layer`

Capa GeoJSON independiente de la implementación del mapa:

- Composable `GeoJSONLayer`
- `GeoJSONFeature` para datos estáticos
- `GeoJSONFeatureState` para integración con Compose state
- `GeoJSONParser` para parseo en lote y por streaming

Funciona con cualquier proveedor de mapas mediante una capa raster basada en tiles. Ver [GeoJSON Layer](/es-419/experimental/geojson-layer/).

### `android-marker-clustering`

Agrupación automática de marcadores para todos los proveedores:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ lastUpdated: false

import { CardGrid, Card } from "@astrojs/starlight/components";
import { Image } from "astro:assets";
import topBanner from "~/assets/top-banner.png";
import topBanner from "~/assets/top-page/english-comic-why-map-conductor.jpg";
import QuickExampleTabs from "~/components/index/QuickExampleTabs.astro";
import Features from "~/components/index/Features.astro";
import MapConductorIntroduction from "~/components/index/MapConductorIntroduction.astro";
Expand Down
24 changes: 24 additions & 0 deletions docs/src/content/docs/ja/core/georectbounds.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,27 @@ import EqualsToExample from '~/components/core/georectbounds/EqualsToExample.ast
### 等価性の比較

<EqualsToExample commentForUsage="使用例" />

## バウンズへのカメラフィット

`GeoRectBounds` が画面内に収まるようにカメラを移動・ズームするには `fitBounds` を使用します:

```kotlin
val bounds = GeoRectBounds(
southWest = GeoPoint.fromLatLong(37.7649, -122.4294),
northEast = GeoPoint.fromLatLong(37.7849, -122.4094)
)
mapViewState.fitBounds(bounds, padding = 32)
```

`padding` パラメーターは全辺にスクリーンスペースのインセット(ピクセル単位)を追加します。ズームレベルの計算は各プロバイダーがネイティブに行うため、プロバイダー間で結果が若干異なる場合があります。

複数のポイントからバウンズを構築してフィットする典型的なパターン:

```kotlin
val bounds = GeoRectBounds()
markers.forEach { bounds.extend(it.position) }
if (!bounds.isEmpty) {
mapViewState.fitBounds(bounds, padding = 48)
}
```
30 changes: 30 additions & 0 deletions docs/src/content/docs/ja/core/mapcameraposition.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,33 @@ MapConductor のズームレベルは、おおよそ Google Maps のスケール
<source src="/mapcameraposition/camera-control-example.webm" type="video/webm" />
<source src="/mapcameraposition/camera-control-example.mp4" type="video/mp4" />
</video>

## バウンズへのフィット

`fitBounds` を使うと、`GeoRectBounds` が画面内に収まるようにカメラを移動・ズームできます:

```kotlin
val bounds = GeoRectBounds(
southWest = GeoPoint.fromLatLong(37.7649, -122.4294),
northEast = GeoPoint.fromLatLong(37.7849, -122.4094)
)
mapViewState.fitBounds(bounds, padding = 32)
```

`padding` パラメーターは全辺にスクリーンスペースのインセット(ピクセル単位)を追加します。ズームレベルの計算は各プロバイダーがネイティブに行います。

### 複数ポイントの表示

マーカーやルートポイントを画面内に収めるには、バウンズを拡張してからフィットします:

<ShowMultiplePointsExample commentForZoomCalculation="手動ズーム計算の代わりに fitBounds を使う" />

上記の手動ズーム計算は `fitBounds` で置き換えられます:

```kotlin
val bounds = GeoRectBounds()
allPoints.forEach { bounds.extend(it) }
if (!bounds.isEmpty) {
mapViewState.fitBounds(bounds, padding = 48)
}
```
2 changes: 1 addition & 1 deletion docs/src/content/docs/ja/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ lastUpdated: false

import { CardGrid, Card } from "@astrojs/starlight/components";
import { Image } from "astro:assets";
import topBanner from "~/assets/top-banner.png";
import topBanner from "~/assets/top-page/japanese-comic-why-map-conductor.jpg";
import QuickExampleTabs from "~/components/index/QuickExampleTabs.astro";
import Features from "~/components/index/Features.astro";
import MapConductorIntroduction from "~/components/index/MapConductorIntroduction.astro";
Expand Down
11 changes: 11 additions & 0 deletions docs/src/content/docs/modules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ Map-implementation-agnostic heatmap overlay:

Works with any map provider via a tile-based raster layer. See [Heatmap](/experimental/heatmap/).

### `android-geojson-layer`

Map-implementation-agnostic GeoJSON layer:

- `GeoJSONLayer` composable
- `GeoJSONFeature` for static data
- `GeoJSONFeatureState` for Compose state integration
- `GeoJSONParser` for bulk and streaming parse

Works with any map provider via a tile-based raster layer. See [GeoJSON Layer](/experimental/geojson-layer/).

### `android-marker-clustering`

Automatic marker clustering across all map providers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import com.mapconductor.example.pages.map.arcgis2d.ArcGISMapView2DPage
import com.mapconductor.example.pages.map.basic.StoreMapPage
import com.mapconductor.example.pages.map.camerasync.CameraSyncPage
import com.mapconductor.example.pages.map.design.MapDesignMapPage
import com.mapconductor.example.pages.map.fitbounds.FitBoundsMapPage
import com.mapconductor.example.pages.map.flyto.FlyToMapIcons
import com.mapconductor.example.pages.map.flyto.FlyToMapPage
import com.mapconductor.example.pages.map.tilt.TiltMapPage
Expand Down Expand Up @@ -113,6 +114,10 @@ fun DemoAppScreen(initPage: String = "map") {
id = "map-flyTo",
title = "Move camera",
),
SidebarItem(
id = "map-fitBounds",
title = "Fit Bounds",
),
SidebarItem(
id = "map-design",
title = "Map design",
Expand Down Expand Up @@ -250,6 +255,11 @@ fun DemoAppScreen(initPage: String = "map") {
onToggleSidebar = navigationViewModel::toggleSidebar,
)
}
"map-fitBounds" -> {
FitBoundsMapPage(
onToggleSidebar = navigationViewModel::toggleSidebar,
)
}
"marker-basic" -> {
MarkerBasicPage(
onToggleSidebar = navigationViewModel::toggleSidebar,
Expand Down
Loading
Loading