Prevent refine location?

587
4
Jump to solution
09-27-2017 07:43 AM
KE
by
Occasional Contributor

AppStudio Desktop Standard License. Quick Report app.

Is there a way to prevent the user from being able to refine the map location?

0 Kudos
1 Solution

Accepted Solutions
nakulmanocha
Esri Regular Contributor

Hey Kristen,

You can use the following code within MapView component to disable the mouse panning completely on RefineLocationPage. But you need to remember that if the position source is unable to provide end user a good location because of network or gps issues then they cannot be able to pin point the exact location. Basically you will get location totally based on how good the device can fetch the current location.

onMousePositionChanged: {
                mouse.accepted = true;
                return;
            }

Something like this

MapView{
            id: mapView
            Layout.preferredWidth: isFullMap? parent.width:(parent.width - 20 *app.scaleFactor)
            Layout.fillHeight: true
            Layout.maximumWidth: isFullMap? Number.POSITIVE_INFINITY: 600 * app.scaleFactor
            anchors.horizontalCenter: parent.horizontalCenter

            property real initialMapRotation: 0

            rotationByPinchingEnabled: true
            zoomByPinchingEnabled: true
            wrapAroundMode: Enums.WrapAroundModeEnabledWhenSupported

            onMousePositionChanged: {
                mouse.accepted = true;
                return;
            }

            backgrou.....

// More code below

Nakul

View solution in original post

4 Replies
KaushikMysorekar
New Contributor III

Hi Kristen,

Please could you explain what do you mean by refining the map location and why you intend to prevent it?

Thanks

0 Kudos
KE
by
Occasional Contributor

In the Quick Report template, in the RefineLocationPage.qml, I am wondering if there is a way to prevent the user from being able to refine the location (aka move the point from the current location). This would be to prevent users from filing a report in a location that they are not physically located at.

0 Kudos
KaushikMysorekar
New Contributor III

Thanks for providing additional details Kristen. I will do some research and let you know if could figure this out.

nakulmanocha
Esri Regular Contributor

Hey Kristen,

You can use the following code within MapView component to disable the mouse panning completely on RefineLocationPage. But you need to remember that if the position source is unable to provide end user a good location because of network or gps issues then they cannot be able to pin point the exact location. Basically you will get location totally based on how good the device can fetch the current location.

onMousePositionChanged: {
                mouse.accepted = true;
                return;
            }

Something like this

MapView{
            id: mapView
            Layout.preferredWidth: isFullMap? parent.width:(parent.width - 20 *app.scaleFactor)
            Layout.fillHeight: true
            Layout.maximumWidth: isFullMap? Number.POSITIVE_INFINITY: 600 * app.scaleFactor
            anchors.horizontalCenter: parent.horizontalCenter

            property real initialMapRotation: 0

            rotationByPinchingEnabled: true
            zoomByPinchingEnabled: true
            wrapAroundMode: Enums.WrapAroundModeEnabledWhenSupported

            onMousePositionChanged: {
                mouse.accepted = true;
                return;
            }

            backgrou.....

// More code below

Nakul