-
-
Notifications
You must be signed in to change notification settings - Fork 860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Add screen-based offset capability to MapController.move
#952
Comments
Could someone point me how to implement this? I believe the plugin has to do this internally anyway since Would be great to expose some utilities that do this calculation as well. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
I had to do this too, and ended up having to copy most of the relevant code in src/map/map.dart 😞. Hope this helps! |
I had the same problem and was able to do it with the following lines:
Would be nice if this is directly provided by the API :-) |
@comatory how do you obtain the size/offset of bottom sheet ? |
There is a way to obtain widget sizes in Flutter, can't tell you from head right now but you use widget's key So I have a handler set up that after user changes size of the bottom sheet by dragging, I look up the size and store the value so I can then use it as an offset later. I also have to do it initially when the widget is mounted. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Bump. I tried using @heebj but that did not work for me. Could we get this functionality built-in? |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
This issue was closed because it has been stalled for 5 days with no activity. |
MapController.move
* Multiple changes, see PR body * Updated CHANGELOG * Added `offset` option to `FlutterMapState.move` and related methods (resolves #1460, #777, #952) Major refactoring and re-organization to improve understandibility * Updated CHANGELOG * Ensure `id` of `MapController.move` is passed through to the emitted `MapEventMove` Originally from #1534 (3eca34e) - thanks @rorystephenson! Co-Authored-By: Rory Stephenson <[email protected]> * Fixed regression in commit 2764747 where internal `MapController` state was not continuous * Added `rotateAroundPoint` - resolves #1460 Co-Authored-By: 6y <[email protected]> * Updated CHANGELOG * Added `TileLayer.fallbackUrl` support to `FileTileProvider` Improved performance of `AssetTileProvider` when `TileLayer.fallbackUrl` not specified (resolves #1436) Improved documentation about performance pitfalls of `TileLayer.fallbackUrl` * Updated CHANGELOG * Updated pubspec.yaml Updated CHANGELOG * Removed `saveLayers` property from `PolylineLayer` * Updated CHANGELOG * Updated MacOS configuration Removed unnecessary Java installation from Windows GitHub Actions builder * Added more position options to `AnchorAlign` Deprecated `AnchorAlign.none` in favour of `AnchorAlign.center` or `null` Improved response/emission time of `onTap`/`MapEventTap` when `InteractiveFlag.doubleTapZoom` is disabled Improved `MarkerLayer`/`Layer` interoperability Improved/reorganized example application Updated CHANGELOG * Simplified `Anchor` Improved documentation of marker anchor methods Improved CHANGELOG * Updated version numbers * Fixed bug in example application * Added automated publishing action for tags in format 'v_._._' * Updated CHANGELOG * Added credit to CHANGELOG --------- Co-authored-by: Rory Stephenson <[email protected]> Co-authored-by: 6y <[email protected]>
I want to actually reopen this issue #777
I think it would be super useful to have. I have used Mapbox Javascript SDK in the past and would take advantage of their ability to calculate offset via pixels.
My use case is that I have map that takes up the whole screen. Then I have bottom sheet that covers the bottom of the map. Now I want to center / move map to programmatically via
MapController
, the problem is the bottom sheet could cover the point where I want to move. The bottom sheet is also expandable, you can pull it up and down so you never know it's size.I could get the height of the sheet in pixels before I center or move the map but at the moment, I can't easily do this since the
move
andmoveAndRotate
method does take any parameter. It seems likefitBounds
uses padding which I'm not sure if it's the same.I might resort to zooming out a bit to make sure it's not completely covered but it'd be really nice to have this feature.
The text was updated successfully, but these errors were encountered: