i am trying to add a "tail" to some GPS movements on a map.
i am using path. but i cant seem to find out how to just add a new segment to the front and remove the last segment at the end.
so i got this silly hack now, always removing the full path and creating a new one.
this works but it flickers, and also is ugly.
any help on using the path API properly?
points is:
val points = mutableListOf<Pair<Double, Double>>()
a list of asNormalizedWebMercator gps coords of the last movement of the "person"
// HACK - HACK - HACK
// HACK - HACK - HACK
GlobalViewModels.osm.state.removeAllPaths()
GlobalViewModels.osm.state.addPath(id = "" + (path_global_hackish_id_cur + 1) + ":::trail:::" + fpubkey) {
addPoints(points)
}
path_global_hackish_id_cur++
if (path_global_hackish_id_cur > 1000)
{
path_global_hackish_id_cur = 1
}
// HACK - HACK - HACK
// HACK - HACK - HACK
i am trying to add a "tail" to some GPS movements on a map.
i am using path. but i cant seem to find out how to just add a new segment to the front and remove the last segment at the end.
so i got this silly hack now, always removing the full path and creating a new one.
this works but it flickers, and also is ugly.
any help on using the path API properly?
points is:
val points = mutableListOf<Pair<Double, Double>>()
a list of asNormalizedWebMercator gps coords of the last movement of the "person"