Skip to content

Commit

Permalink
Pushing version 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Matias Dahlin Holst committed Nov 28, 2024
1 parent e1248fa commit 21b7796
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 26 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 4.0.0

See the [migration guide](https://docs.mapsindoors.com/sdks-and-frameworks/flutter/migration-guide).

### Added

* Added `initialCameraPosition: MPCameraPosition` to the `MapWidget` constructor. If set, the initial position of the camera will be moved to the given `MPCameraPosition`.

### Changed

* Changed all uses of color `Strings` to use `dart:ui` `Color` instead.
* Updated Mapsindoors SDKs:
* Android to 4.9.0
* iOS to 4.7.0

### Removed

* `DirectionsService` `ClearWayType` has been removed, use `ClearAvoidWayType` instead.

## 3.1.3

### Fixed
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A federated Flutter plugin for integrating with the native MapsIndoors SDK.

| Platform | Android | iOS |
| ------------ | ------- | ----- |
| **Supports** | SDK 21+ | 13.0+ |
| **Supports** | SDK 21+ | 14.0+ |

## Features

Expand All @@ -21,7 +21,7 @@ This plugin is based on the MapsIndoors V4 SDK for Android and iOS.
Add MapsIndoors to your `pubspec.yaml`.

```yaml
mapsindoors_mapbox: ^3.0.0
mapsindoors_mapbox: ^4.0.0
```
### Android
Expand Down Expand Up @@ -149,6 +149,8 @@ class MapWidgetState extends State<MapWidget> {
child: _mapController = MapsIndoorsWidget(
// build with the default floor selector, this is optional.
floorSelector: _floorSelectorWidget,
// set an optional starting location for the camera, this starts the camera above Los Angeles
initialCameraPosition: MPCameraPosition(zoom: 7, MPPoint.withCoordinates(longitude: -118.0165, latitude: 33.9457))
readyListener: _mapControlReadyListener,
),
),
Expand Down Expand Up @@ -235,7 +237,7 @@ The `hideLocationsByDefault()` method hides all markers that are not explicitly

The `showLocationsByDefault()` method ensures all markers are shown by setting the main display rule to visible.

The `changeTypePolygonColor(String type, String color)` method changes the fill color for all polygons belonging to a specific type. It gets the display rule for the specified type using `getDisplayRuleByName`, and sets the fill color using `setPolygonFillColor`.
The `changeTypePolygonColor(String type, Color color)` method changes the fill color for all polygons belonging to a specific type. It gets the display rule for the specified type using `getDisplayRuleByName`, and sets the fill color using `setPolygonFillColor`.

These methods can all be used to customize the display of markers and polygons on the map.

Expand All @@ -255,8 +257,7 @@ void showLocationsByDefault() async {
}
/// This method changes the fill color for all polygons belonging to a specific [type]
/// the [color] MUST be a valid hex color string.
void changeTypePolygonColor(String type, String color) async {
void changeTypePolygonColor(String type, Color color) async {
final MPDisplayRule? rule = await getDisplayRuleByName(type);
rule?.setPolygonFillColor(color);
}
Expand Down
2 changes: 1 addition & 1 deletion example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ app.*.map.json
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
/android/app/release
7 changes: 0 additions & 7 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
dependency_overrides:
mapsindoors_mapbox_android:
path: ../../mapsindoors_mapbox_android
mapsindoors_mapbox_ios:
path: ../../mapsindoors_mapbox_ios
mapsindoors_platform_interface:
path: ../../../misdkfl-platform

dev_dependencies:
integration_test:
Expand Down
8 changes: 6 additions & 2 deletions lib/core/mapsindoors_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class MapsIndoorsWidget extends UniqueWidget {
final Alignment? floorSelectorAlignment;
final bool useDefaultMapsIndoorsStyle;
final OnMapReadyListener? readyListener;
final MPCameraPosition? initialCameraPosition;

/// Build the widget, MapsIndoors currently supports the following platforms:
/// * Android
Expand All @@ -36,6 +37,7 @@ class MapsIndoorsWidget extends UniqueWidget {
this.floorSelector,
this.floorSelectorAlignment,
this.readyListener,
this.initialCameraPosition,
this.useDefaultMapsIndoorsStyle = true,
}) : super(key: const GlobalObjectKey(MapsIndoorsWidget)) {
if (readyListener != null) {
Expand Down Expand Up @@ -350,7 +352,7 @@ class MapsIndoorsWidget extends UniqueWidget {
///
/// If any value is null, the corresponding field will not be updated.
Future<void> setLabelOptions(
{num? textSize, String? color, bool showHalo = false}) {
{num? textSize, Color? color, bool showHalo = false}) {
return MapcontrolPlatform.instance
.setLabelOptions(textSize, color, showHalo);
}
Expand Down Expand Up @@ -401,7 +403,9 @@ class _MapsIndoorsState extends State<MapsIndoorsWidget> {
"useDefaultMapsIndoorsStyle": widget.useDefaultMapsIndoorsStyle,
}),
"floorSelectorAutoFloorChange":
widget.floorSelector?.isAutoFloorChangeEnabled == true
widget.floorSelector?.isAutoFloorChangeEnabled == true,
"initialCameraPosition":
jsonEncode(widget.initialCameraPosition?.toJson()),
};

final floorSelector = widget.floorSelector ?? MPDefaultFloorSelector();
Expand Down
2 changes: 1 addition & 1 deletion lib/core/mp_directions_renderer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MPDirectionsRenderer {
.setAnimatedPolyline(animated, repeating, durationMs);

/// Set the colors of the polyline
Future<void> setPolyLineColors(String foreground, String background) =>
Future<void> setPolyLineColors(Color foreground, Color background) =>
DirectionsRendererPlatform.instance
.setPolyLineColors(foreground, background);

Expand Down
5 changes: 0 additions & 5 deletions lib/core/mp_directions_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ class MPDirectionsService {
Future<void> addExcludeWayType(String avoidWayType) =>
DirectionsServicePlatform.instance.addExcludeWayType(avoidWayType);

/// Clears all added avoidWayTypes
@Deprecated("Deprecated since 4.3.0. Use clearAvoidWayType() instead")
Future<void> clearWayType() =>
DirectionsServicePlatform.instance.clearAvoidWayType();

/// Clears all added avoidWayTypes
Future<void> clearAvoidWayType() =>
DirectionsServicePlatform.instance.clearAvoidWayType();
Expand Down
2 changes: 1 addition & 1 deletion lib/core/mp_map_label_font.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ part of '../mapsindoors.dart';

class MPMapLabelFont {
final String typeface;
final String color;
final Color color;
final bool showHalo;
const MPMapLabelFont({
required this.typeface,
Expand Down
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: mapsindoors_mapbox
description: A MapsIndoors flutter plugin using the Mapbox platform for Android and iOS app usage.
version: 3.1.3
version: 4.0.0
repository: https://github.com/MapsPeople/mapsindoors_flutter_mapbox
homepage: https://www.mapsindoors.com/

Expand All @@ -19,9 +19,9 @@ flutter:
dependencies:
flutter:
sdk: flutter
mapsindoors_mapbox_android: ^3.1.3
mapsindoors_mapbox_ios: ^3.1.3
mapsindoors_platform_interface: ^3.1.3
mapsindoors_mapbox_android: ^4.0.0
mapsindoors_mapbox_ios: ^4.0.0
mapsindoors_platform_interface: ^4.0.0


dev_dependencies:
Expand Down

0 comments on commit 21b7796

Please sign in to comment.