Skip to content

creating a trail with paths #48

Description

@zoff99

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions