Mapbox: User speed and distance traveled - ios

I am using Mapbox and Swift 3. I am trying to know what the speed of the user is as well as the distance traveled since the activity started. Any advice on how to do that?
Thank you!

This isn’t a Mapbox question — you’ll want to run your own location manager or use some other iOS-provided API to track user location beyond what is shown on a map. Have a look around Stack Overflow: this answer may be helpful.

Related

Positioning of location markers on top of location?

I followed the above tutorial (link) to make a sample app which will show markers depending upon the location coordinates for the objects(like a building) .I'm able to show my custom markers on the given location .But markers are floating around the location.How can fix my marker to show on the top of the building .?
Any suggestion or advice...
Thanks in advance!!!!!!
Your problem is most likely due to sensor jitter. Gyroscopes usually don't provide an stable reading.
I suggest you do a rolling average of the values and also add thresholds for minimum variation.

Indoor Atlas: iOS SDK doesn't give accurate position when device stops moving

I downloaded the Indoor Atlas iPhone SDK and also generated path maps and test paths for my venue. SDK navigates me perfectly when I am moving from one place to another but when I stop moving it generates scattered output with the position radius from 10 to 25. I am expecting precise co-ordinates in both the above cases in my project.
Is there any way to get more precision?
IndoorAtlas technology is using the history of magnetic field observations for computing the precise location. This means that the device needs to move some distance in order to collect enough data to converge to a correct location estimate, i.e., to have a location fix. We are constantly improving our service to decrease the time needed for the first location fix.
If you experience your position moving after you've already stopped walking yourself, please contact support#indooratlas.com with details of your application and venue where this is experienced and we'll look into it. Thanks!

Is there a way to calculate small distances with CoreMotion?

Is it possible to calculate small distances with CoreMotion?
For example a user moves his iOS device up or down, left and right and facing the device in front of him (landscape).
EDIT
Link as promised...
https://www.youtube.com/watch?v=C7JQ7Rpwn2k position stuff starts at about 23 minutes in.
His summary...
The best thing to do is to try and not use position in your app.
There is a video that I will find to show you. But short answer... No. The margin for error is too great and the integration that you have to do (twice) just amplifies this error.
At best you will end up with the device telling you it is slowly moving in one direction all the time.
At worst it could think it's hurtling around the planet.
2020 Update
So, iOS has added the measure app that does what the OP wanted. And uses a combination of accelerometer and gyroscope and magnetometer in the phone along with ARKit to get the external reference that I was talking about in this answer.
I’m not 100% certain but if you wanted to do something like the OP was asking you should be able to dig into ARKit and find some apis in there that do what you want.
👍🏻

How to wrap locations that are close to each other in a single marker with Mapkit?

I am looking for a good and fast way to wrap locations that are in a specific range on a MKMapView in a single marker. Clicking on that marker brings you closer to the center point of this locations. You can see what I mean on the picture below.
mc donalds app - map sample screen
My first thought was to check a specific pixel range for each marker, hide the ones that are closer than X pixels to each other and get the center of them to create a new marker.
Did anyone of you ever did something similar?
There's a demo from WDC 11 or 10 that does exactly that, and coalesces based on proximity, not grid. Much better looking than DTCluster.
After a while of searching an testing, I found several frameworks for this like:
REVClusterMap, SuperPin, DTClusterMaker and a lot more. At the moment I stick with "REMarkerClusterer". It's pretty simple to implement and is free (MIT License)
https://github.com/romaonthego/REMarkerClusterer
Here is a nice article about clustering:
http://applidium.com/en/news/too_many_pins_on_your_map/
If someone else has good frameworks for this in his bookmarks/github-list, please post it here. I sill would like to see them ...

WP7: How do I get valid GPS values?

I'm trying to make my own cycle app.
When I start the app, I press a button ... now I want to measure how far (distance) I've cycled. When I'm done, I want to draw my route on a map.
How do I do this? Any sample of this somewhere? .. and I guess I need to wait for a perfect GPS signal before measuring distance ... how do I do this?
Thanks!!!
Mojo
MSDN has a documentation explaining the use of Location on the phone at http://msdn.microsoft.com/en-us/library/ff431803(v=vs.92).aspx
There is also a sample app for capturing location information at http://go.microsoft.com/fwlink/?LinkID=229128
To get an approximate measure of the distance travelled, you could use calls to GeoCoordinate.GetDistanceTo to measue the distance between each point captured. The accuracy of this would be dependent on the number of points gathered on the journey.

Resources