hemanthrajv / flutter_compass

MIT License
102 stars 188 forks source link

Compass heading for android is different than iOS #105

Open securexperts opened 8 months ago

securexperts commented 8 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 5 months ago

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