Skip to content

Comments

Public interface camera api#944

Merged
maios merged 9 commits intorepo-structure-multi-pluginsfrom
public-interface-camera-api
May 16, 2025
Merged

Public interface camera api#944
maios merged 9 commits intorepo-structure-multi-pluginsfrom
public-interface-camera-api

Conversation

@maios
Copy link
Contributor

@maios maios commented May 15, 2025

What does this pull request do?

  • Moved ScreenCoordinate, MbxEdgeInsets, CameraOptions and CameraState to mapbox_maps_flutter_interface
  • Allow camera to be set upon Map initization, and add API to get/set camera.
  • Provide web implementations

What is the motivation and context behind this change?

Pull request checklist:

  • Add a changelog entry.
  • Write tests for all new functionality. If tests were not written, please explain why.
  • Add documentation comments for any added or updated public APIs.

PRs must be submitted under the terms of our Contributor License Agreement CLA.

@maios maios requested a review from a team as a code owner May 15, 2025 13:38
@maios maios requested review from evil159 and pjleonard37 May 15, 2025 13:38
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:mapbox_maps_flutter/mapbox_maps_flutter.dart';
import 'package:mapbox_maps_flutter_interface/mapbox_maps_flutter_interface.dart'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is the way to go - the examples need to import the public package not the internal one.

@override
Future<void> setCamera(CameraOptions cameraOptions) {
if (cameraOptions.center != null) {
cameraOptions.center = Point._from(cameraOptions.center!);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this have to be re-assigned?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initially I left the part where we extend turf's Point in mobile package, that's why I had to cast type here so the Codec would understand, otherwise it would throw an error Invalid type. But now I moved those extensions to interface package and removed this cast

@maios maios requested a review from evil159 May 16, 2025 09:36
@maios maios merged commit 71117fc into repo-structure-multi-plugins May 16, 2025
4 of 6 checks passed
@maios maios deleted the public-interface-camera-api branch May 16, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants