Skip to content

Commit 7218276

Browse files
authored
chore: v0.3.0 release preparation (#355)
- [x] versioned docs - [x] release `maplibre_ios` to pub.dev - [x] update changelog - [x] update github action that publishes to pub.dev - [x] remove path dependencies - [x] prepare GitHub release - [x] ~~enable package score action~~, requires specified version of `maplibre_ios` on pub.dev
1 parent 885879e commit 7218276

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+3110
-733
lines changed

.github/workflows/publish.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@ on:
66
- 'v[0-9]+.[0-9]+.[0-9]+*'
77

88
jobs:
9-
publish:
10-
name: 'Publish to pub.dev'
9+
publish-maplibre-ios:
10+
name: "Publish `maplibre_ios`"
1111
permissions:
12-
id-token: write # This is required for requesting the OIDC
13-
runs-on: ubuntu-latest
14-
if: github.repository_owner == 'josxha'
15-
steps:
16-
- uses: actions/checkout@v5
17-
- uses: dart-lang/setup-dart@v1
18-
# --force skips the y/N confirmation
19-
# --skip-validation because of "Because maplibre requires the Flutter SDK, version solving failed. Flutter users should use `flutter pub` instead of `dart pub`."
20-
# see https://github.com/dart-lang/setup-dart/issues/68
21-
- name: Publish to pub.dev
22-
working-directory: ${{ inputs.working-directory }}
23-
run: dart pub publish --force --skip-validation
12+
id-token: write
13+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
14+
with:
15+
working-directory: maplibre_ios
16+
publish-maplibre:
17+
name: "Publish `maplibre`"
18+
permissions:
19+
id-token: write
20+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
21+
with:
22+
working-directory: .

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

.pubignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
docs/
22
example/assets/
3-
pigeons/
4-
maplibre_ios/
3+
pigeons/

CHANGELOG.md

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,58 @@
1-
# next
1+
# 0.3.0
22

3-
- `MapController#setStyle` no longer returns a Future. To know when the map
4-
style has loaded, listen to `MapLibreMap#onStyleLoaded`
3+
In this release, I'm blazed to finally announce support for iOS.
4+
Similar to our other platforms, iOS uses FFI to natively interop between Dart
5+
and Swift/ObjC. Checkout
6+
the [iOS documentation](https://flutter-maplibre.pages.dev/docs/getting-started/setup-ios)
7+
to get started.
8+
A big thanks to @mhernz, @gabbopalma and @jt274 that helped with their awesome
9+
contributions in this release!
10+
11+
This release introduces breaking changes. Head over to
12+
the [migration guide](https://flutter-maplibre.pages.dev/docs/upgrade) to learn
13+
more on how to update your implementation.
14+
15+
### New Features
16+
17+
- **Breaking** Require Flutter 3.35
18+
- **Breaking** Migrate from `geotypes`
19+
to [geobase](https://pub.dev/packages/geobase).
20+
- **Breaking** Return logical pixels in events on all platforms.
21+
- **Breaking** Add `screenPoint` parameter to `MapEventUserInput` events to show
22+
the screen coordinates in logical pixels where the user interacted with the
23+
map.
24+
- **Breaking** Rename `rotationDuration` in `MapCompass` to
25+
`nativeRotationDuration`.
26+
- **Breaking** Multiple `MapController` functions are now called synchronously,
27+
their `*Sync()` overloads have been removed.
28+
- **Breaking** All declarative layers now require a `FeatureCollection`. This
29+
allows users to add properties to their layers.
30+
- Add iOS as supported platform with MapLibre Native iOS 6.18.
31+
- Update MapLibre Native Android to 11.13
32+
- Load map styles from Flutter assets, a JSON string or via URI.
33+
- Add `setStyle()`, to know when the map style has loaded, listen to
34+
`onStyleLoaded()`.
35+
- Add support for PMTiles on the web.
36+
- Add `androidTranslucentTextureSurface` and `androidForegroundLoadColor` to use
37+
a translucent map.
38+
- Add `MapScalebar.units` to support imperial units in the scalebar.
39+
- Add `featuresAtPoint()` and `featuresInRect()` to `MapController`.
40+
- Update to `pigeon` 26.0.0
41+
42+
### Bug Fixes
43+
44+
- Fix missing export of `BearingRenderMode`
45+
- Remove `dart:io` import to fix pub.dev WASM compatibility detection
46+
47+
Full
48+
Changelog: [v0.2.2...v0.3.0](https://github.com/josxha/flutter-maplibre/compare/v0.2.2...v0.3.0)
549

650
## 0.2.2
751

8-
Maintenance release and some new functionality.
52+
Maintenance release and some new functionality.
953
Thanks for your contribution in this release @jt274!
1054

11-
## New Features
55+
### New Features
1256

1357
- Migrate `requestLocationPermissions()` and `addLayer()` to use JNI
1458
- Update `jni` and `jnigen` to v0.14

docs/.yarn/install-state.gz

51.6 KB
Binary file not shown.

docs/docs/architecture.md

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,46 @@ for `maplibre`.
1010
## Abstraction Layers
1111

1212
```mermaid
13-
flowchart TD
14-
MapLibreMap -->|uses| MapLibreMapState
15-
MapLibreMapState -->|extends| MapLibreMapStateNative
16-
MapLibreMapStateNative -->|extends| MapLibreMapStateAndroid
17-
MapLibreMapStateNative -->|extends| MapLibreMapStateIos
18-
MapLibreMapState --->|extends| MapLibreMapStateWeb
19-
MapController -->|implements| MapLibreMapState
20-
MapLibreMapStateAndroid -->|method channel, jni| Kotlin([Kotlin])
21-
MapLibreMapStateIos -->|method channel, ffi| Swift([Swift])
22-
MapLibreMapStateWeb -->|interop| TypeScript([TypeScript])
13+
flowchart TB
14+
subgraph User["User Implementation"]
15+
end
16+
subgraph Public["Public API"]
17+
MapLibreMap
18+
MapController
19+
StyleController
20+
end
21+
22+
subgraph Widget["StatefulWidget"]
23+
MapLibreMapState
24+
end
25+
26+
subgraph Pigeon["Platform Channels (Pigeon)"]
27+
MapLibreMapStateNative
28+
end
29+
30+
subgraph Interop["Native Interop (FFI / JNI)"]
31+
MapLibreMapStateAndroid
32+
MapLibreMapStateIos
33+
MapLibreMapStateWeb
34+
end
35+
36+
subgraph Native["Native Code"]
37+
Android["Android (Kotlin, Java)"]
38+
iOS["iOS (Swift, Objective C)"]
39+
Web["Web (TypeScript)"]
40+
end
41+
42+
User --> MapLibreMap
43+
MapLibreMap --> MapLibreMapState
44+
MapController --> MapLibreMapState
45+
StyleController --> MapLibreMapState
46+
MapLibreMapState --> MapLibreMapStateNative
47+
MapLibreMapStateNative --> MapLibreMapStateAndroid
48+
MapLibreMapStateNative --> MapLibreMapStateIos
49+
MapLibreMapState --> MapLibreMapStateWeb
50+
MapLibreMapStateAndroid --> Android
51+
MapLibreMapStateIos --> iOS
52+
MapLibreMapStateWeb --> Web
2353
```
2454

2555
### 1. Public API

docs/docs/getting-started/add-dependency.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ run `flutter pub get`:
1818
```yaml title="pubspec.yaml"
1919
dependencies:
2020
# highlight-next-line
21-
maplibre: ^0.2.0
21+
maplibre: ^0.3.0
2222
```
2323
2424
Ensure that you use the documentation of the right

docs/docs/getting-started/setup-android.md

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ sidebar_position: 20
77
## Use a compatible Kotlin version
88

99
Ensure that you are using Kotlin version
10-
**1.9.0** or newer. You can check the most recent Kotlin version on
10+
**1.9.0 or newer**. You can check the most recent Kotlin version on
1111
[kotlinlang.org](https://kotlinlang.org/docs/releases.html#release-details).
1212

13-
### (new) Gradle with a declarative plugins block
14-
1513
Open `android/settings.gradle` and set the Kotlin version like this:
1614

1715
```gradle title="android/settings.gradle"
@@ -22,10 +20,11 @@ plugins {
2220
}
2321
```
2422

25-
In case you can't find the `plugins {}` block your app still uses the old apply
26-
script method.
2723

28-
### (old) In a legacy apply script gradle file
24+
25+
<details>
26+
<summary>In case you can't find the `plugins {}` block your app still uses the old apply
27+
script method. Click here to view the instructions.</summary>
2928

3029
Open `android/app/build.gradle` and set the Kotlin version like this:
3130

@@ -37,36 +36,7 @@ buildscript {
3736
}
3837
```
3938

40-
## Adjust the minSdk version of Android
41-
42-
The `maplibre` package on Flutter
43-
uses [platform views](https://docs.flutter.dev/platform-integration/android/platform-views)
44-
to display the native map. This requires an Android SDK version of at least 23
45-
(Android 6.0).
46-
47-
:::tip
48-
49-
The app compiles with a minSdk version of down to 21. However, the MapLibre map
50-
won't be visible on these Android versions. You can check for the SDK version
51-
with [device_info_plus](https://pub.dev/packages/device_info_plus)
52-
and render an alternative map as a workaround or limit the supported Android
53-
versions to Android 6.0 and onwards like demonstrated here.
54-
55-
:::
56-
57-
Open your `android/app/build.gradle` file and ensure that it is set to 23 or
58-
higher.
59-
60-
```gradle title="android/app/build.gradle"
61-
android {
62-
defaultConfig {
63-
// ...
64-
// highlight-next-line
65-
minSdk = 23 // previously flutter.minSdkVersion
66-
// ...
67-
}
68-
}
69-
```
39+
</details>
7040

7141
## Set the permissions
7242

@@ -85,7 +55,3 @@ manifest`android/app/src/main/AndroidManifest.xml`.
8555
// highlight-end
8656
</manifest>
8757
```
88-
89-
Starting from Android API level 23 you also need to request it at runtime.
90-
You can use the `PermissionManager` for it (only available with version 0.1.2 or
91-
later).

docs/docs/getting-started/setup-ios.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,18 @@ sidebar_position: 30
66

77
## Activate the Swift Package Manager
88

9-
The Swift Package Manager is available in Flutter 3.35 in the `stable`
10-
channel but needs to be enabled by running the following command:
9+
The Swift Package Manager is available in the `stable` channel since
10+
Flutter 3.24 but needs to be enabled by running the following command:
1111

1212
```bash
1313
flutter config --enable-swift-package-manager
1414
```
15+
16+
You can also add it just for this project by adding the following line to the
17+
pubspec.yaml file of your app:
18+
19+
```yaml title="pubspec.yaml"
20+
flutter:
21+
config:
22+
enable-swift-package-manager: true
23+
```

docs/docs/sources.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
sidebar_position: 70
3+
---
4+
5+
# Sources
6+
7+
MapLibre can use a variety of different data sources for its style layers.
8+
You can use the same source for multiple style layers.
9+
10+
## Data
11+
12+
### GeoJSON
13+
14+
You can use
15+
the [GeoJsonSource](https://pub.dev/documentation/maplibre/latest/maplibre/GeoJsonSource-class.html)
16+
to attach data like points, lines or polygons. The data can then be used in a
17+
[StyleCircleLayer](style-layers/circle-layer),
18+
[FillStyleLayer](style-layers/fill-layer),
19+
[HeatmapStyleLayer](style-layers/heatmap-layer),
20+
[LineStyleLayer](style-layers/line-layer) or
21+
[SymbolStyleLayer](style-layers/symbol-layer).
22+
23+
An example use cases is to display and visualize any kind of data on the map.
24+
25+
## Media
26+
27+
### Image
28+
29+
Use
30+
the [ImageSource](https://pub.dev/documentation/maplibre/latest/maplibre/ImageSource-class.html)
31+
If you want to render an image on the map.
32+
33+
An example use case is to position a weather radar image on the map.
34+
35+
### Video
36+
37+
Likewise,
38+
the [VideoSource](https://pub.dev/documentation/maplibre/latest/maplibre/VideoSource-class.html)
39+
can be used to render a video on the map.
40+
41+
The video source is only supported on web.
42+
43+
## Tiles
44+
45+
The most common way to use a tile source is by an URL. This can either be
46+
47+
- the direct URL of a tile server, e.g. `https://example.com/{z}/{x}/{y}.mvt`
48+
- the URL of a [TileJSON](https://github.com/mapbox/tilejson-spec) that provides
49+
a tile server with additional metadata, e.g. `https://example.com/tiles.json`
50+
- a PMTiles file by adding `pmtiles://` in front of your url, e.g.
51+
`pmtiles://https://example.com/tiles.pmtiles` or
52+
`pmtiles://files://path/tiles.pmtiles`
53+
54+
### Raster Tiles
55+
56+
The [RasterSource](https://pub.dev/documentation/maplibre/latest/maplibre/RasterSource-class.html)
57+
can be used to add a raster tile server. Raster tiles are images that are
58+
positioned in a grid next to each other on the map. They are hosted on a tile
59+
server that follows the format `z/x/y.png` or any other image file extension.
60+
61+
A common use case is to display a satellite map using
62+
a [RasterStyleLayer](style-layers/raster-layer).
63+
64+
### Raster DEM Tiles
65+
66+
Raster DEM tiles are similar to regular [raster tiles](#raster-tiles) but are
67+
used in the [HillshadeStyleLayer](style-layers/hillshade-layer) to display
68+
elevation. Use
69+
the [RasterDemSource](https://pub.dev/documentation/maplibre/latest/maplibre/RasterDemSource-class.html)
70+
for it.
71+
72+
### Vector Tiles
73+
74+
Last but not least you can use
75+
the [VectorSource](https://pub.dev/documentation/maplibre/latest/maplibre/VectorSource-class.html)
76+
to supply the map with a source of Mapbox Vector Tiles (MVT). The data is then
77+
shown in a combination of circle, fill, line and symbol layers on the map.

0 commit comments

Comments
 (0)