flutterdartgoogle-mapsbearing

How to make google map camera bearing follow behind user like in Waze App


I am making a navigation App, I am able to update the camera position according to the user location however I have no idea how to make the camera bearing follow the user from behind like in waze and google map navigation. I am using flutter and this code to update the camera on user position

mapController.animateCamera(CameraUpdate.newCameraPosition(CameraPosition(
                              target: LatLng(userposition.latitude,
                                  userposition.longitude),
                              zoom: 18, 

can anyone help me ?

I am planning to make the camera follow the user like this,

enter image description here


Solution

  • As much as I'd like to help you, I'm afraid trying to create/reproduce real-time navigation functionality using Google Maps API products could be against their Terms of Service.

    As I am not a legal expert, it would be best to be in touch with one to review your use case if it is compliant with 3.2.3 Restrictions Against Misusing the Services, (d) No Re-Creating Google Products or Features:

    "Customer will not use the Services to create a product or service with features that are substantially similar to or that re-create the features of another Google product or service. Customer’s product or service must contain substantial, independent value and features beyond the Google products or services. For example, Customer will not: (i) re-distribute the Google Maps Core Services or pass them off as if they were Customer’s services; (ii) use the Google Maps Core Services to create a substitute of the Google Maps Core Services, Google Maps, or Google Maps mobile apps, or their features; (iii) use the Google Maps Core Services in a listings or directory service or to create or augment an advertising product; (iv) combine data from the Directions API, Geolocation API, and Maps SDK for Android to create real-time navigation functionality substantially similar to the functionality provided by the Google Maps for Android mobile app."

    If you are just looking into showing navigation instructions between two points, you can use the Directions actions of Maps URLs to achieve this. You can find more info on this here: https://developers.google.com/maps/documentation/urls/guide

    There is no publicly available navigation API at this time. However, as I've mentioned on my comment on your question, Google is currently offering an industry solution, targeted to ridesharing verticals. For more info, you need to contact the sales department.

    You can find more info on the ride sharing offering, as well as a link to the Sales form, here: https://cloud.google.com/maps-platform/ridesharing/