mapbox / mapbox-maps-flutter

Interactive, thoroughly customizable maps for Flutter powered by Mapbox Maps SDK
https://www.mapbox.com/mobile-maps-sdk
Other
266 stars 101 forks source link

A few observations #250

Open willipe53 opened 10 months ago

willipe53 commented 10 months ago

I'm sure there will be more, but after a week of working earnestly with this library:

1) An object named ScreenCoordinate should store pixels, not latitude and longitude. 2) Any object, regardless of name, storing latitude and longitude as x and y needs to instead store them as y and x. 3) The MapboxMap should be able to report its visible area (e.g. screen size) in lat-lng or pixels. 4) ==(Object other) => other is PointAnnotation && id == other.id, please. 5) Implement OnPointAnnotationDragListener(PointAnnotation pa) so I don't have to implement my own.

securexperts commented 9 months ago

Hi

I not agree on all your comments. Basically a Map library works with coordinates and distances, not with pixels. Of course we need somehow to know screen size in pixels and its relation to the map but nothing more.

Thanks

xinoxapps commented 9 months ago

Walking through the example for the first time, I miss in my opinion the most obvious feature related to annotations.

Or maybe I'm missing something.


class AnnotationClickListener extends OnPointAnnotationClickListener {
  @override
  void onPointAnnotationClick(PointAnnotation annotation) {
    print("onAnnotationClick, viewPoint: ${annotation.viewPoint}");
    // display Dialog or PopupMenu at viewPoint
  }
}
jimvandijk commented 7 months ago

Hello there, @willipe53

If you do not mind my asking, from your usage of the mapbox_maps_flutter sdk, do you have a way to get the center coordinates of the visible map region?

willipe53 commented 7 months ago

Hello there, @willipe53

If you do not mind my asking, from your usage of the mapbox_maps_flutter sdk, do you have a way to get the center coordinates of the visible map region?

var coordinates = (await mapboxMap.getCameraState()).center["coordinates"];
gorkemhacioglu commented 2 months ago

Regarding to topic 3, I totally agree. It must be implemented after a while.

final CameraBounds bounds = await _controller.getBounds();