strukturart / o.map

Open Street Map app - KaiOS
MIT License
81 stars 14 forks source link

fix markers list generation for markers selection #39

Closed cmomin closed 2 years ago

cmomin commented 2 years ago

I don't know if this was a desired feature, but I encountered a problem when selecting markers: after having performed some jumps between existing markers (i.e., pressing "*"), the markers that were added afterwards (i.e., by pressing "9") were not taken into account by future jumps.

I identified that the lists of markers was generated only once when the first marker jump/selection was performed.

To fix the identified issue, I added the flag "f_upd_markers_list" in "module.js" that keep track of any marker addition / deletion. More practically, the accessor function "set_f_upd_markers()" is called from "index.js" to raise the flag when either a marker is added or deleted. The list of markers "contained" is rebuilt if this flag is set at each call of the function "select_markers()". The flag is reset at each list re-building to avoid unnecessary operation when no modification of marker has been made.

Hope it helps.

strukturart commented 2 years ago

Thank you!