Hello MITers,
I have a map with a location sensor and that workes.
The yellow-man appears at the centre of the mapscreen on my location.
Now I swipe the map away to a different location and after a few seconds the yellow-man moves the centre back to his position.
Q: How do I disable the locationSensor? LocationSensor1 Enabled to False.
But how do I detect the map movement/swipe action?
When Map1 TapAtPoint does not do it.
Have you read/tried this tutorial * Using the Location Sensor . It will help you understand how the LocationSensor workss.
Yes. Set LocationSensor1.Enabled to False.
This should happen automatically if Map1.EnableMapPan AND Map1.EnableZoom are both set to Enabled in the Map Properties. I believe the defaults are enabled.
In your app Properties, do you set LocationSensor as shown in the image. I recommend developers do this. by selecting LocationSensor1 as shown.. Doing this allows developers to link the two controls. If you do this you can use the LS to set it's refresh TimeInterval to sensible values.
That is correct. That function is used to retrieve information about the point tapped if you provide a Label or Notification to show the location coordinates. or other things.
Hello Steve,
Thank you for the reply.
I have the (default) settings as you mentioned.
So the automatic location update should stop if you swipe the display!
Sofar it does not, so I made somewhere a mistake.
I tried with a Set LocationSensor1 to False at the end of the 'Screen initialize' but that fails as well.
But somewhere later in the program (button click) it stops as requested.
Maybe a timing (delay) issue. (the locationSensor1 has a timinginterval of 10000)
At least I know now that it should stopping updating after a swipe action.
Thanks and regards
CeeBee
No. Swiping the screen does NOT prevent the location from updating the screen.
Since you set the timinginterval of 10000 (every10 seconds) and link LS to Map, the LS will attempt to use the gps receiver to achieve a satellite fix and if it does should trigger a LocationChanged event.
Oh, after a swipe action the screen will request a different the OSM server to display a different tile set for the map. In itself, this might affect the current instructions but should still 'update' the map.
You might wish to share an image of your Blocks here and explain to us why you want to stop updating the map. Most apps would want to continuously run.
I have about 40 locations with WW2 bunker remains.
First i find my location. Then i want to select one of the 40 markers and click on it for finding the route.
This all works if i am fast, but most of the time the map is centered back to my location before i can click on one of the markers.
This the reason for asking the starting question.
Sending blocks is a bit early
A guess is you have one of these Blocks.in an LocationChanged event handler or tripped by a Clock. Both of these codes instruct your app Map to recenter itself based on your current location from your LocationSensor... You could use a Button to enable/disable the recentering.