Skip to content

Commit

Permalink
Expose LineJoin.NONE (#613)
Browse files Browse the repository at this point in the history
* Bump Maps SDK to 11.5.0

* Expose LineJoin.NONE

* Replace plugin references with SDK. (#614)

* Bump version to 2.1.0 (#615)

* Replace plugin references with SDK.

* Bump version to 2.1.0

* Update changelog
  • Loading branch information
evil159 committed Jul 9, 2024
1 parent e99cca7 commit 776f68b
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 25 deletions.
36 changes: 34 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,39 @@
### main
### 2.1.0

* Bump Maps SDK to 11.5.0.
* Add ModelLayer API.
* Support for offline map, allowing users to download and store map data on their devices for use in environments with limited or no internet connectivity.
* Layer expressions support. Specify expressions when constructing a layer with all new expression support for layers.
*Before:*
```dart
mapboxMap.style.setStyleLayerProperty("layer", "line-gradient",
'["interpolate",["linear"],["line-progress"],0.0,["rgb",255,0,0],0.4,["rgb",0,255,0],1.0,["rgb",0,0,255]]');
```
*After:*
```dart
LineLayer(
...
lineGradientExpression: [
"interpolate",
["linear"],
["line-progress"],
0.0,
["rgb", 255, 0, 0],
0.4,
["rgb", 0, 255, 0],
1.0,
["rgb", 0, 0, 255]
],
);
```
* Expose `text-occlusion-opacity`, `icon-occlusion-opacity`, `line-occlusion-opacity`, `model-front-cutoff`, `lineZOffset` as experimental.
* Add min/max/default values for most of the style properties.
* Expose `clusterMinPoints` property for `GeoJSONSource`.
* Expose `SlotLayer` and `RasterParticleLayer`.
* Expose `LocationComponentSettings.slot`.
* Add `@experimental` annotation to relevant APIs.
* Expose `LineJoin.NONE`.
* Bump Maps SDK to 11.5.0 for Android and 11.5.1 for iOS.

### 2.1.0-rc.1

Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
### License

Mapbox Maps Flutter Plugin
Mapbox Maps Flutter SDK

Copyright © 2022 - 2023 Mapbox, Inc. All rights reserved.

The software and files in this repository (collectively, “Software”) are licensed under the Mapbox TOS for use only with the relevant Mapbox product(s) listed at www.mapbox.com/pricing. This license allows developers with a current active Mapbox account to use and modify the authorized portions of the Software as needed for use only with the relevant Mapbox product(s) through their Mapbox account in accordance with the Mapbox TOS. This license terminates automatically if a developer no longer has a Mapbox account in good standing or breaches the Mapbox TOS. For the license terms, please see the Mapbox TOS at https://www.mapbox.com/legal/tos/ which incorporates the Mapbox Product Terms at www.mapbox.com/legal/service-terms. If this Software is a SDK, modifications that change or interfere with marked portions of the code related to billing, accounting, or data collection are not authorized and the SDK sends limited de-identified location and usage data which is used in accordance with the Mapbox TOS. [Updated 2023-01]

## Additional Mapbox Maps Flutter Plugin licenses
## Additional Mapbox Maps Flutter SDK licenses

[enum_to_string](https://pub.dev/packages/enum_to_string).

Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mapbox Maps SDK Flutter Plugin
# Mapbox Maps SDK Flutter SDK

The Mapbox Maps SDK Flutter Plugin is an officially developed solution from Mapbox that enables use of our latest Maps SDK product (v11.5.0). The plugin allows developers to embed highly customized maps using a Flutter widget on Android and iOS.
The Mapbox Maps SDK Flutter SDK is an officially developed solution from Mapbox that enables use of our latest Maps SDK product (v11.5.0). The SDK allows developers to embed highly customized maps using a Flutter widget on Android and iOS.

Web and desktop are not supported.

Expand Down Expand Up @@ -44,7 +44,7 @@ Contributions welcome!

## Requirements

The Maps Flutter Plugin is compatible with applications:
The Maps Flutter SDK is compatible with applications:

- Deployed on iOS 12 or higher
- Built using the Android SDK 21 or higher
Expand All @@ -53,7 +53,7 @@ The Maps Flutter Plugin is compatible with applications:
## Installation

### Configure credentials
To run the Maps Flutter Plugin you will need to configure the Mapbox Access Tokens.
To run the Maps Flutter SDK you will need to configure the Mapbox Access Tokens.
Read more about access tokens and public/secret scopes at the platform [Android](https://docs.mapbox.com/android/maps/guides/install/#configure-credentials) or [iOS](https://docs.mapbox.com/ios/maps/guides/install/#configure-credentials) docs.

#### Secret token
Expand All @@ -70,7 +70,7 @@ To access platform SDKs you will need to create a secret access token with the `
```

#### Public token
You can set the access token for Mapbox Maps Flutter Plugin(as well as for every Mapbox SDK) via `MapboxOptions`:
You can set the access token for Mapbox Maps Flutter SDK(as well as for every Mapbox SDK) via `MapboxOptions`:
```
MapboxOptions.setAccessToken(ACCESS_TOKEN);
```
Expand Down Expand Up @@ -107,15 +107,15 @@ String ACCESS_TOKEN = String.fromEnvironment("ACCESS_TOKEN");
```

### Add the dependency
To use the Maps Flutter Plugin add the git dependency to the pubspec.yaml:
To use the Maps Flutter SDK add the git dependency to the pubspec.yaml:

```
dependencies:
mapbox_maps_flutter: ^2.1.0-rc.1
mapbox_maps_flutter: ^2.1.0
```

### Configure permissions
You will need to grant location permission in order to use the location component of the Maps Flutter Plugin.
You will need to grant location permission in order to use the location component of the Maps Flutter SDK.

You can use an existing library to request location permission, e.g. with [permission_handler](https://pub.dev/packages/permission_handler) `await Permission.locationWhenInUse.request();` will trigger permission request.

Expand Down Expand Up @@ -155,7 +155,7 @@ It also allows or add listeners for various events - related to style loading, m
#### MapboxMap controller
The `MapboxMap` controller instance is provided with `MapWidget.onMapCreated` callback.

`MapboxMap` exposes an entry point to the most of the APIs Maps Flutter Plugin provides. It allows to control the map, camera, styles, observe map events,
`MapboxMap` exposes an entry point to the most of the APIs Maps Flutter SDK provides. It allows to control the map, camera, styles, observe map events,
query rendered features, etc.

It's organized similarly to the [Android](https://docs.mapbox.com/android/maps/api/11.5.0/mapbox-maps-android/com.mapbox.maps/-mapbox-map/) and [iOS](https://docs.mapbox.com/ios/maps/api/11.5.0/documentation/mapboxmaps/mapboxmap) counterparts.
Expand Down Expand Up @@ -237,7 +237,7 @@ You can find more examples of the AnnotationManagers usage in the sample app : [
## Map styles
Platform docs : [Android](https://docs.mapbox.com/android/maps/guides/styles/), [iOS](https://docs.mapbox.com/ios/maps/guides/styles/).

The Mapbox Maps Flutter Plugin allows full customization of the look of the map used in your application.
The Mapbox Maps Flutter SDK allows full customization of the look of the map used in your application.

### Set a style
You can specify the initial style uri at `MapWidget.styleUri`, or load it at runtime using `MapboxMap.loadStyleURI` / `MapboxMap.loadStyleJson` :
Expand Down Expand Up @@ -276,7 +276,7 @@ To apply an expression to interpolate gradient color to a line layer:

## Camera and animations
Platform docs : [Android](https://docs.mapbox.com/android/maps/guides/camera-and-animation/), [iOS](https://docs.mapbox.com/ios/maps/guides/camera-and-animation/).
The camera is the user's viewpoint above the map. The Maps Flutter Plugin provides you with options to set and adjust the camera position, listen for camera changes, get the camera position, and restrict the camera position to set bounds.
The camera is the user's viewpoint above the map. The Maps Flutter SDK provides you with options to set and adjust the camera position, listen for camera changes, get the camera position, and restrict the camera position to set bounds.

### Camera position
You can set the starting camera position using `MapWidget.cameraOptions` :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ fun LineJoin.toLineJoin(): com.mapbox.maps.extension.style.layers.properties.gen
LineJoin.BEVEL -> com.mapbox.maps.extension.style.layers.properties.generated.LineJoin.BEVEL
LineJoin.ROUND -> com.mapbox.maps.extension.style.layers.properties.generated.LineJoin.ROUND
LineJoin.MITER -> com.mapbox.maps.extension.style.layers.properties.generated.LineJoin.MITER
LineJoin.NONE -> com.mapbox.maps.extension.style.layers.properties.generated.LineJoin.NONE
else -> throw(RuntimeException("Unsupported LineJoin: $this"))
}
}
Expand All @@ -43,6 +44,7 @@ fun com.mapbox.maps.extension.style.layers.properties.generated.LineJoin.toFLTLi
com.mapbox.maps.extension.style.layers.properties.generated.LineJoin.BEVEL -> LineJoin.BEVEL
com.mapbox.maps.extension.style.layers.properties.generated.LineJoin.ROUND -> LineJoin.ROUND
com.mapbox.maps.extension.style.layers.properties.generated.LineJoin.MITER -> LineJoin.MITER
com.mapbox.maps.extension.style.layers.properties.generated.LineJoin.NONE -> LineJoin.NONE
else -> throw(RuntimeException("Unsupported LineJoin: $this"))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ enum class LineJoin(val raw: Int) {
/** A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line. */
ROUND(1),
/** A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet. */
MITER(2);
MITER(2),
/** Line segments are not joined together, each one creates a separate line. Useful in combination with line-pattern. Line-cap property is not respected. Can't be used with data-driven styling. */
NONE(3);

companion object {
fun ofRaw(raw: Int): LineJoin? {
Expand Down
2 changes: 1 addition & 1 deletion example/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# mapbox_maps_example

Demonstrates how to use the mapbox_maps plugin.
Demonstrates how to use the Mapbox Maps Flutter SDK.

## Getting Started

Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PODS:
- Flutter (1.0.0)
- integration_test (0.0.1):
- Flutter
- mapbox_maps_flutter (2.1.0-rc.1):
- mapbox_maps_flutter (2.1.0):
- Flutter
- MapboxMaps (~> 11.5.1)
- Turf (= 2.8.0)
Expand Down Expand Up @@ -49,7 +49,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
integration_test: ce0a3ffa1de96d1a89ca0ac26fca7ea18a749ef4
mapbox_maps_flutter: 07bd5180ffcd126dc5b44556654a14475ade81d2
mapbox_maps_flutter: c7e9ddad4b3e7e68397fc0f8643ff408913dc44f
MapboxCommon: c69a04a1accd77650372c96d8978a15ed1d95186
MapboxCoreMaps: 9d8833b738b94d63ee842722641e8cfdc1fa1191
MapboxMaps: 24a52620178b5390373489c083d4a3acd319c1d3
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ packages:
path: ".."
relative: true
source: path
version: "2.1.0-rc.1"
version: "2.1.0"
matcher:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: mapbox_maps_example
description: Demonstrates how to use the mapbox_maps_flutter plugin.
description: Demonstrates how to use the Mapbox Maps Flutter SDK.
version: "1.0.0-beta.1"

# The following line prevents the package from being accidentally published to
Expand Down
2 changes: 2 additions & 0 deletions ios/Classes/EnumsMapping.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ extension MapboxMaps.LineJoin {
case .bEVEL: self = .bevel
case .rOUND: self = .round
case .mITER: self = .miter
case .nONE: self = .none
}
}

Expand All @@ -58,6 +59,7 @@ extension MapboxMaps.LineJoin {
case .bevel: return .bEVEL
case .round: return .rOUND
case .miter: return .mITER
case .none: return .nONE
default: return nil
}
}
Expand Down
2 changes: 2 additions & 0 deletions ios/Classes/Generated/PolylineAnnotationMessenger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ enum LineJoin: Int {
case rOUND = 1
/// A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet.
case mITER = 2
/// Line segments are not joined together, each one creates a separate line. Useful in combination with line-pattern. Line-cap property is not respected. Can't be used with data-driven styling.
case nONE = 3
}

/// Controls the frame of reference for `line-translate`.
Expand Down
2 changes: 1 addition & 1 deletion ios/mapbox_maps_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'mapbox_maps_flutter'
s.version = '2.1.0-rc.1'
s.version = '2.1.0'

s.summary = 'Mapbox Maps SDK Flutter Plugin.'
s.description = 'An officially developed solution from Mapbox that enables use of our latest Maps SDK product.'
Expand Down
2 changes: 1 addition & 1 deletion lib/src/map_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class _MapWidgetState extends State<MapWidget> {
'textureView': widget.textureView,
'styleUri': widget.styleUri,
'channelSuffix': _suffix,
'mapboxPluginVersion': '2.1.0-rc.1',
'mapboxPluginVersion': '2.1.0',
'eventTypes': _events.eventTypes.map((e) => e.index).toList(),
};

Expand Down
3 changes: 3 additions & 0 deletions lib/src/pigeons/polyline_annotation_messenger.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: mapbox_maps_flutter
description: A Flutter plugin for integrating Mapbox Maps SDK v11 in Android/iOS application.
version: 2.1.0-rc.1
description: Interactive, thoroughly customizable maps powered by Mapbox Maps mobile SDKs.
version: 2.1.0
homepage: https://github.com/mapbox/mapbox-maps-flutter

environment:
Expand Down

0 comments on commit 776f68b

Please sign in to comment.