maplibre / flutter-maplibre-gl

Customizable, performant and vendor-free vector and raster maps, flutter wrapper for maplibre-native and maplibre-gl-js (fork of flutter-mapbox-gl/maps)
https://pub.dev/packages/maplibre_gl
Other
226 stars 125 forks source link

attributionButtonPosition is not working #283

Closed timautin closed 1 year ago

timautin commented 1 year ago

Hello,

When creating a map with this code:

var map = MaplibreMap(
  styleString: "assets/resources/map_style.json",
  annotationOrder:            const [ AnnotationType.line, AnnotationType.circle, AnnotationType.fill, AnnotationType.symbol ],
  annotationConsumeTapEvents: const [ AnnotationType.fill, AnnotationType.line, AnnotationType.circle, AnnotationType.symbol ],
  initialCameraPosition: const CameraPosition(target: LatLng(0, 0), zoom: 5),
  onMapCreated: _onMapCreated,
  onStyleLoadedCallback: _onStyleLoadedCallback,
  attributionButtonPosition: AttributionButtonPosition.BottomLeft,
  attributionButtonMargins: const Point(10, 10),
);

The attributionButtonPosition & attributionButtonMargins options are not taken into account and the attribution stays at the bottom right corner with no margins.

Expected result: the attribution should be at the bottom left corner, 10 px from the bottom & 10 px from the left.

EDIT: the problem is on web, it works as expected on Android.

JulianBissekkou commented 1 year ago

Please let us know on what platform this issue happens.

timautin commented 1 year ago

Hi Julian, On web. I just ran on Android and it works as expected.

ouvreboite commented 1 year ago

For information, the following log is printed when running on web:

setAttributionButtonAlignment not available in web

Coming from: https://github.com/maplibre/flutter-maplibre-gl/blob/5d4923986c981e4f0b5c366491c4aabb49bffd56/maplibre_gl_web/lib/src/mapbox_web_gl_platform.dart#L635

It seems the capability exists in MapLibre JS, but the mapping is not done yet: https://maplibre.org/maplibre-gl-js/docs/examples/attribution-position/

timautin commented 1 year ago

I was about to say that I saw this log and that maybe I'd do it, but you've been faster, thank you very much :)

m0nac0 commented 1 year ago

Closed by #304