Select to view content in your preferred language

Press to Locate only in S123 Geopoint

194
3
Jump to solution
08-07-2024 01:01 PM
BlakeMunshell
Occasional Contributor

I used to have no issue with this, but in the last two years, something has changed with the way geopoint collection works. Basically, I want the user to only click on the cross hair when they arrive at the location, and I do not want them to be able to manually adjust their location. In the past, I would just set "appearance" to 'press-to-locate' and "readonly" to 'yes'. However, that combination looks like this in the mobile app: 

BlakeMunshell_0-1723060236641.png

Clicking the crosshair or the whitespace do nothing, and it seems I cannot capture location this way. 

If I set "appearance" to 'press-to-locate' and "readonly" to blank, it looks like this: 

BlakeMunshell_1-1723060404022.png

This is not acceptable because of the map option where users can update their location. My current work around is to check the horizontalAccuracy (which sets to 0 if the user manually adjusts their location), and massively negatively weight those points. 

If I set "appearance" to blank and "readonly" to 'yes', it looks like this: 

BlakeMunshell_2-1723060675812.png

It attempts to immediately capture my location, which causes many issues. Users may not have left their car or entered the exact field they are capturing, or if their accuracy is poor, it will keep searching for their location even after they leave the field. 

 

What I would like is just the crosshair icon, with no map icon next to it. How can I achieve this? Do I have some setting somewhere changed that I am missing? 

1 Solution

Accepted Solutions
MarikaVertzonis
Esri Regular Contributor

There is no way to remove the map icon, but you could take your horizontalAccuracy observation a step further and turn it into a location quality expression that constrains manual adjustment. 

The following is what the xlsform would look like with the constraint in place. (Not shown here, but appearance for the geopoint is set to press-to-locate, but I favored showing the calculation and constraint columns in this screenshot)

MarikaVertzonis_0-1724193005121.png

In this case, when the horizontalAccuracy1 question is empty (ie: no horizontal accuracy value received), the constraint expression evaluates to 0. Constraint messages appear when the constraint expression evaluates to false. A string-length of 0 is equivalent to false in this context. 

In the form, you would still start with the minimal view of the location question, and if someone presses the location button here, it will populate with the expected device location.

MarikaVertzonis_1-1724193005124.png

But if the user then presses the map (or presses the map icon before the location icon), they would still go to the full map page. If they were to manually move the location, when they return to the form they would see this custom constraint message (and not be able to submit the record). 

MarikaVertzonis_2-1724193005130.png

They could press the location icon here, or even do so in the full map page, and the constraint message would go away.

MarikaVertzonis_3-1724193005138.png

 

It might also be better to use other properties in your expression, for example:

pulldata(“@geopoint”, ${location}, “positionSourceType”) >= 2 and pulldata(“@geopoint”, ${location}, “positionSourceType”) <= 4

or

pulldata(“@geopoint”, ${location}, “positionSourceType”) = 1

 

All of the properties are listed in Extract geopoint values.

 

If you didn't want it to be a hard constraint, you could add this expression to the bind::esri:warning and bind::esri:warning_message columns instead. For more information, see Location quality expressions.

 

 

 

View solution in original post

3 Replies
BlakeMunshell
Occasional Contributor

If I type "bump", will this get boosted back to the top of the forum? 

0 Kudos
MarikaVertzonis
Esri Regular Contributor

There is no way to remove the map icon, but you could take your horizontalAccuracy observation a step further and turn it into a location quality expression that constrains manual adjustment. 

The following is what the xlsform would look like with the constraint in place. (Not shown here, but appearance for the geopoint is set to press-to-locate, but I favored showing the calculation and constraint columns in this screenshot)

MarikaVertzonis_0-1724193005121.png

In this case, when the horizontalAccuracy1 question is empty (ie: no horizontal accuracy value received), the constraint expression evaluates to 0. Constraint messages appear when the constraint expression evaluates to false. A string-length of 0 is equivalent to false in this context. 

In the form, you would still start with the minimal view of the location question, and if someone presses the location button here, it will populate with the expected device location.

MarikaVertzonis_1-1724193005124.png

But if the user then presses the map (or presses the map icon before the location icon), they would still go to the full map page. If they were to manually move the location, when they return to the form they would see this custom constraint message (and not be able to submit the record). 

MarikaVertzonis_2-1724193005130.png

They could press the location icon here, or even do so in the full map page, and the constraint message would go away.

MarikaVertzonis_3-1724193005138.png

 

It might also be better to use other properties in your expression, for example:

pulldata(“@geopoint”, ${location}, “positionSourceType”) >= 2 and pulldata(“@geopoint”, ${location}, “positionSourceType”) <= 4

or

pulldata(“@geopoint”, ${location}, “positionSourceType”) = 1

 

All of the properties are listed in Extract geopoint values.

 

If you didn't want it to be a hard constraint, you could add this expression to the bind::esri:warning and bind::esri:warning_message columns instead. For more information, see Location quality expressions.

 

 

 

BlakeMunshell
Occasional Contributor

Hi Marika, 

It's not perfect (although, things rarely are), but I suppose it does the job. Thanks! 

0 Kudos