flutter-mapbox-gl / maps

A Mapbox GL flutter package for creating custom maps
Other
1.04k stars 503 forks source link

Compasse is not displaying on the map #1427

Open nik2001-app opened 4 days ago

nik2001-app commented 4 days ago

I am using version 0.16.0 This is the my MapboxMap config:

final MapboxMap mapboxMap = MapboxMap( accessToken: MyApp.ACCESS_TOKEN, onMapCreated: onMapCreated, initialCameraPosition: _kInitialPosition, trackCameraPosition: true, compassEnabled: _compassEnabled, compassViewPosition: CompassViewPosition.TopRight, cameraTargetBounds: _cameraTargetBounds, minMaxZoomPreference: _minMaxZoomPreference, styleString: _styleStrings[_styleStringIndex], rotateGesturesEnabled: _rotateGesturesEnabled, scrollGesturesEnabled: _scrollGesturesEnabled, tiltGesturesEnabled: _tiltGesturesEnabled, zoomGesturesEnabled: _zoomGesturesEnabled, doubleClickZoomEnabled: _doubleClickToZoomEnabled, myLocationEnabled: _myLocationEnabled, myLocationTrackingMode: _myLocationTrackingMode, myLocationRenderMode: MyLocationRenderMode.GPS, onMapClick: (point, latLng) async { print( "Map click: ${point.x},${point.y} ${latLng.latitude}/${latLng.longitude}"); print("Filter $_featureQueryFilter"); List features = await mapController! .queryRenderedFeatures(point, ["landuse"], _featureQueryFilter); print('# features: ${features.length}'); _clearFill(); if (features.isEmpty && _featureQueryFilter != null) { ScaffoldMessenger.of(context).showSnackBar(const SnackBar( content: Text('QueryRenderedFeatures: No features found!'))); } else if (features.isNotEmpty) { _drawFill(features); } }, onMapLongClick: (point, latLng) async { print( "Map long press: ${point.x},${point.y} ${latLng.latitude}/${latLng.longitude}"); Point converted point = await mapController!.toScreenLocation(latLng); LatLng convertedLatLng = await mapController!.toLatLng(point); print( "Map long press converted: ${convertedPoint.x},${convertedPoint.y} ${convertedLatLng.latitude}/${convertedLatLng.longitude}"); double metersPerPixel = await mapController!.getMetersPerPixelAtLatitude(latLng.latitude);