hemanthrajv / flutter_compass

MIT License
98 stars 141 forks source link

Compass heading for android is different than iOS #105

Open securexperts opened 3 months ago

securexperts commented 3 months ago

Hi

Any idea why my Heading for android is different than iOS. I need to correct it about 45degrees to be OK Here my Code I use:

setCameraPosition(Position puckPositionToSet) { double headingCorrection; if (Platform.isAndroid) { headingCorrection = 45.0; } else { headingCorrection = 0.0; }

mapboxMap.flyTo(
  CameraOptions(
    center: Point(coordinates: puckPositionToSet).toJson(),
    padding: defaultEdgeInsets,
    bearing: _compassRotationBearing!.heading!.toDouble()+headingCorrection,
  ),
  null,
);

}

Thanks for your comments

robcleghorn commented 1 month ago

https://github.com/hemanthrajv/flutter_compass/issues/31