Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
736ef94
Change default color for lines in maps
seadowg Jan 8, 2026
36fad66
Simplify MapIconCreator interface
seadowg Jan 9, 2026
ecd7772
Add convenience extension for create marker icon bitmaps
seadowg Jan 9, 2026
c825cc2
Add new specific icon for line points
seadowg Jan 9, 2026
12b6cd8
Fill center of shapes
seadowg Jan 9, 2026
b05cc7a
Make first point in polygon bigger
seadowg Jan 9, 2026
98c9d9b
Fix constructor use in tests
seadowg Jan 9, 2026
71dc983
Update default color tests
seadowg Jan 9, 2026
cdc6503
Fix assertions on MarkerIconDescription
seadowg Jan 9, 2026
6a76557
Correct method name
seadowg Jan 13, 2026
dff3c30
Update implementations
seadowg Jan 13, 2026
2b6491d
Store line points in GeoPolyFragment instead of in MapFragment
seadowg Jan 13, 2026
be829c4
Fix clear behaviour
seadowg Jan 14, 2026
b6c1276
Remove unneeded formatting for shape
seadowg Jan 14, 2026
29b7bb3
Switch to using polygons with map for shapes
seadowg Jan 14, 2026
8415fc2
Don't use new API for Google and Mapbox
seadowg Jan 14, 2026
7e585a2
Highlight last point rather than first
seadowg Jan 14, 2026
d5f30e7
Remove add/remove methods for poly points
seadowg Jan 15, 2026
3d90579
Store LocationTracker location in Flow
seadowg Jan 15, 2026
b45e310
Expose location as StateFlow
seadowg Jan 15, 2026
7d09ee0
Remove unused field
seadowg Jan 15, 2026
0f8d2f2
Use ViewModel for points state
seadowg Jan 15, 2026
e576fa6
Use LocationTracker to schedule location recording
seadowg Jan 15, 2026
91b0bea
Fix whitespace issue
seadowg Jan 15, 2026
6ae1adb
Add updatePolyLine method
seadowg Jan 15, 2026
d0281d4
Add updatePolygon method
seadowg Jan 15, 2026
2774e36
Simplify feature description constructor calls
seadowg Jan 15, 2026
055f227
Highlight last point with different color
seadowg Jan 15, 2026
f3147e3
Update fake
seadowg Jan 15, 2026
3e07038
Clean up unneeded code
seadowg Jan 15, 2026
d508feb
Break up single line
seadowg Jan 19, 2026
974898f
Rename method
seadowg Jan 19, 2026
a63222a
Rename class
seadowg Jan 19, 2026
f3c1845
Remove double save to cache
seadowg Jan 19, 2026
46f0155
Correct whitespace
seadowg Jan 19, 2026
16eabc9
Fix formatting
seadowg Jan 19, 2026
2164907
Correct typo
seadowg Jan 19, 2026
72a978f
Use isNotEmpty
seadowg Jan 19, 2026
f6ded2d
Use last()
seadowg Jan 19, 2026
35ae10e
Remove redundant let
seadowg Jan 19, 2026
e6d579d
Remove redundant alpha setting
seadowg Jan 19, 2026
0b63d63
Only update map when points updated
seadowg Jan 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Don't use new API for Google and Mapbox
  • Loading branch information
seadowg committed Jan 19, 2026
commit 8415fc2703d99f2807703cf025454c3a21d6141c
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ class GeoPolyFragment @JvmOverloads constructor(

map!!.clearFeatures()

if (outputMode == OutputMode.GEOSHAPE) {
if (map!!.supportsDraggablePolygon() && outputMode == OutputMode.GEOSHAPE) {
featureId = map!!.addPolygon(
PolygonDescription(
line,
Expand All @@ -594,7 +594,8 @@ class GeoPolyFragment @JvmOverloads constructor(
line,
null,
null,
!readOnly
!readOnly,
outputMode == OutputMode.GEOSHAPE
)
)
}
Expand Down
2 changes: 1 addition & 1 deletion maps/src/main/java/org/odk/collect/maps/LineDescription.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data class LineDescription(
private val strokeWidth: String? = null,
private val strokeColor: String? = null,
val draggable: Boolean = false,
val closed: Boolean = false
@Deprecated("Use PolygonDescription instead") val closed: Boolean = false
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our line/polygon API for MapFragment was in a weird state where you could add draggable or static lines, static polygons and draggale or static closed lines. We got away with the latter because we didn't need to fill them, but now we do they need to be proper polygons under the hood.

) {
fun getStrokeWidth(): Float {
return try {
Expand Down
4 changes: 4 additions & 0 deletions maps/src/main/java/org/odk/collect/maps/MapFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ interface MapFragment {
*/
fun hasCenter(): Boolean

fun supportsDraggablePolygon(): Boolean {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lets us implement in just OSM while not completely breaking other engines. I think we should follow up with Mapbox/Google Maps implementations as that allows us to keep the change sets small and do the work in parallel if we can.

return false
}

fun interface ErrorListener {
fun onError()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,11 @@ public MapViewModel getMapViewModel() {
return mapViewModel;
}

@Override
public boolean supportsDraggablePolygon() {
return true;
}

/**
* A MapFeature is a physical feature on a map, such as a point, a road,
* a building, a region, etc. It is presented to the user as one editable
Expand Down