0

currently, i'm developing a map application similar to uber, and since im using Googles location service " intermitent thread " , i get the users location every 10-20-30 seconds and i update its new location on the map, by simply cleaning the existing List , and inserting another mark inside of it.

That makes it looks like the users icon is literally " teleporting " across the map.

ive made some researches and i was unable to find examples or of its possible to be done in Heremaps explorer edition.

I'm aware that all i gotta do is work with only one object instead of clearing my list and placing another object in it.

Any help would be appreciated, thanks in advance.

1 Answers1

0

With the Explore Edition of the HERE SDK you can use the flyTo() method of the MapCamera. The speed and type of the animations between two distinctive coordinates can be heavily customized.

Just to give a simple example how you can move between two coordinates without "teleporting":

private void flyTo(GeoCoordinates geoCoordinates) {
    GeoCoordinatesUpdate geoCoordinatesUpdate = new GeoCoordinatesUpdate(geoCoordinates);
    double bowFactor = 1;
    MapCameraAnimation animation =
            MapCameraAnimationFactory.flyTo(geoCoordinatesUpdate, bowFactor, Duration.ofSeconds(3));
    mapCamera.startAnimation(animation);
}

Whenever you set a new coordinate as target to the camera, it will instantly switch to that location - hence it looks like teleporting. With a linear (or bow like above) animation it will look smoother and in fact the coordinates between the previous and the new location are "interpolated".

With the Navigate Edition, there's also an InterpolationListener, which can be used to provide smooth interpolated location updates when a positioning source is used.

Nusatad
  • 3,231
  • 3
  • 11
  • 17
  • thansk @Nusatad that 'll actually help me a lot, but what i asked was wether or not i could move the object MARKER in a smooth way, currently im working on a list of markers and i set a new marker object everytime i get new coordinates what i actually want to do is work on the same object so that i could illustrate it moving whenever i get new coordinates. – Victor Pierre May 03 '22 at 20:50
  • If you want to just move an object on the map (without moving the map), you can do this as well. The MapMarker's location can be updated any time. Now, you only need to get the coordinates in-between. This is something to solve on app-side and it is called interpolation. I would recommend using Android's ValueAnimator to interpolate between two values. A usage example is shown here: https://github.com/heremaps/here-sdk-examples/blob/e33cab23e344815c71c6f85504d73244088d2dd9/examples/latest/lite/android/CameraLite/app/src/main/java/com/here/sdk/camera/CameraAnimator.java#L79 – Nusatad May 10 '22 at 11:52
  • do you happen to know the equivalent of this import com.here.sdk.mapviewlite.Camera; on explorer edition ? – Victor Pierre Jun 02 '22 at 19:53
  • Yes, it is "import com.here.sdk.mapview.MapCamera". See this Explore app for more: https://github.com/heremaps/here-sdk-examples/blob/master/examples/latest/explore/android/Camera/app/src/main/java/com/here/sdk/camera/CameraExample.java – Nusatad Jun 04 '22 at 05:42
  • im sorry to insist so much on the matter since youve kind of already answered . but im struggling to find a way to move a marker on the explorer edition. you have mentioned a way thro interpolator and linked me to a github repo. But that only works for LITE edition , and thats a way to make the camera.flyTo() method which already exists in explorer. im looking for a way to move the map marker on the map like uber does, with the same existing icon , to animate its position to new coordinates. do u think thats possible to do wiht explorer ? – Victor Pierre Jun 07 '22 at 20:08