ror
ror

Reputation: 3500

Alternative for com.google.maps.android.SphericalUtil in HMS

Standard HMS converter does nothing to SphericalUtil.computeOffset (of com.google.maps.android:android-maps-utils). At the same time it depends on 'com.google.android.gms.maps.model.LatLng'. Is there an alternative in HMS world (for SphericalUtil, copy pasting from https://github.com/googlemaps/android-maps-utils does not count)?

Upvotes: 2

Views: 570

Answers (1)

Zinna
Zinna

Reputation: 2035

In Huawei there is opensource for doing spherical map function:

https://github.com/SupasinTatiyanupanwong/huawei-maps-utils

in here we can do Spherical geometry — for example: computeDistance, computeHeading, computeArea

dependencies {
    implementation 'me.tatiyanupanwong.supasin.android.libraries.huawei.maps:maps-utils:1.0.0-alpha02'
} 

and do

double distance = SphericalUtil.computeDistanceBetween(mMarkerA.getPosition(), mMarkerB.getPosition());

Upvotes: 0

Related Questions