Is it possible to track the actual driven distance with the car in an Flutter App with Google Maps API? - flutter

So basically, I want to have a button where I can begin the tracking, and when I click the second time, the driven route should be displayed on the map and the driven distance (in kilometres) should be displayed.
I searched up the Internet but found no solution on that.
I would be happy if anyone could help me, thanks.

For as far as I'm concerned this can not be achieved via a Google Maps API.
Like Andy replied in a comment on your question, you can keep track of the coordinates from the Geolocator package (https://pub.dev/packages/geolocator) and compute the distance between each sequential point (Maps Toolkit provides these functions: https://pub.dev/packages/maps_toolkit).
Add these up and you have an approximation of the distance. How more often you keep track of the location, how more accurate it will be.
Keep in mind: if you track based on time, the approximation may be less accurate due the (higher) speed of the device that's travelling. I'd suggest you adjust the interval of point-tracking based on the speed.

Related

How to create an online database for a swift game to store player scores?

I am looking to create something along these lines.
http://www.iostutorial.org/2011/06/17/add-high-scores-to-your-ios-game/
However, i want it to be online so it stores high scores of players and displays top 10 scores.
it would be of great help if someone could point me in the right direction. Any books or articles would be great.
Game center is designed specifically for what you are trying to do. It has the added advantage that it will provide exposure for your game, potentially increasing sales.

How do I record game wins in swift for iOS to Game Center?

I would like my app to not only report a total score earned back to Game Center, but I would like to report current game 'Won' STATUS and total games won in the Leaderboard (as well as report back to the user).
Essentially I want the Game Center Leaderboard to report back total 'WINS', not just points. For the life of me I can not find any code examples that would accomplish this, nor am I finding any information that notes this is even possible.
So I guess this is a two part question: Is this possible (to report a game is won STATUS) and, if it is possible, can someone point me in the right direction to look at some example code that would accomplish this?
I believe, through my exhaustive research, that this is not possible. Game Center essentially records total points, and I believe they can only go up. It is not possible to simply add/subtract. It just simply accumulates. In addition, Game Center does not seem to offer the ability to record match wins vs. match losses. So there wouldn't be any data for me to query on that either. I'm exploring using a backend data service to create my own leaderboard. This was my conclusion after a week or so of research, but please feel free to correct me; I'm still looking for a solution! Thanks!

Points System for rewarding participation within sports league

Suppose player's scores determine their rank within a their division within a tournament. The, points are allocated according to their rank. The website hosts seasonal scores and tracks players cumulative points.
Thus, I am seeking a rewards system via php/mysql that would allow players to redeem their points for merchandise.
I have seen "points systems" for user interaction via web sites and only assume a similar system could be set up using player's performance points as described above.
I do not have PHP or DB coding abilities but feel this entirely possible. Has anyone seen a similar scenario as I have described? Just looking for thoughts and comments from those more knowledgeable than I on this subject. Thank you.
I, as well, felt it was possible. I have just have not seen any real world examples with similar circumstances. The "points and rewards" systems observed on the web seem to award points based on user interactions with the site rather than "on field" performance.
Possibly, the better question would be is where does one go to have such a system developed (allowing that I personally do not and will not have these abilities)??

Google turn by turn API (iPhone)

I can't find API from Google which provides turn by turn based directions. Just wanted to make sure if this type is even public? If not, what are my alternatives on iOS?
Thanks!
Have you tried Googling "Google Maps Directions API"? This is easy to find on Google or in the Google Maps API homepage.
http://code.google.com/apis/maps/documentation/directions/
"Each element in the steps array defines a single step of the
calculated directions. A step is the most atomic unit of a direction's
route, containing a single step describing a specific, single
instruction on the journey. E.g. "Turn left at W. 4th St." The step
not only describes the instruction but also contains distance and
duration information relating to how this step relates to the
following step. For example, a step denoted as "Merge onto I-80 West"
may contain a duration of "37 miles" and "40 minutes," indicating that
the next step is 37 miles/40 minutes from this step."
When I implemented this on Android, I passed a URI formatted string with an address to the OS which called the included turn-by-turn navigation which I recall was a 3rd party api (but shipped with the OS). Now that I'm developing iOS, I too would like to identify a solution on iPhone. As far as I can tell so far, there is no similar API for iOS (yet). I actually hope that I'm wrong here.
Hope this helps.

Suggestions for a web-based streaming charting tool

Afternoon all,
I'm looking for a way of presenting near realtime data using line charts within my web application. Specifically, my requirements are as follows:
It should support zooming (with the mouse wheel too!), scrolling, selecting different time ranges, etc.
It should support presenting data at multiple resolutions within a single chart. The default view would be the past 24 hours (using data at one minute resolution), but if the user zoomed out or browsed back further in time then lower resolution data would be used. On the daily view, we'll have 1440 points per line (there'll be at least two). If we lower this to hourly averages when zoomed out further, we're looking at 720 points per month per line. We can lower the resolution further after that too.
Ideally, if the user zoomed into a historical date the graph would poll a server to see if high resolution data was available for that period, and if so, fetch it and update the graph area.
Streaming data support. Namely, the graph would fetch deltas every X minutes and append them to the graph.
We're open to using Flash, Java, Silverlight or pure Javascript for the presentation layer, although Flash would probably be the strongest preference.
I've spent a fair bit of time looking around for something that would fit the bill here and have (surprisingly) not found much. Here's some brief notes from my research:
a) Google Finance charts are pretty much exactly what I want to achieve, but it seems that their public version of these charts (the Annotated Timeline Chart) is comparatively very limited. It does not allow for streaming data, and if you want to redraw graph data (e.g. when changing the selected date range) you get a nasty flicker as the chart area reloads with the new data.
b) Timepedia Chronoscope charts sound promising at first glance, with support for incremental data loading. However, there seems to be no documentation or examples of this (all examples use a static dataset from .js files)
c) We've seen charts such as Open Flash Chart and others like this, but they don't have the "wow factor" that Google Finance charts do.
Any suggestions welcome!
I would suggest Highcharts - very neat SVG and javascript-based charts. There's also an example called Live Random Data which updates a spline ever second - this would be useful for your streaming requirements. The zooming and scrolling is available: Master Detail Chart, but everything depends on how much data you'll be pointing out.
In my experiments earlier this year, I managed to have around 20 graphs with over 40 plots each running smoothly in Firefox, but more than that could give out tiny delays, so in that sense yeah, you'll be better off with Flash, although I doubt that anybody would be able to read 20 splines at a time ;)
Hope that helped. Cheers!