
TMS FNC Maps: Faster loading of GPX tracks
GPX files make it easy to display routes on maps. TMS FNC Maps comes with built-in support which makes it one line of code to draw a track on a map.
Map.LoadGPXFromFile( AFilename );
There are plenty of overloads for that method. The most recent version of the map control even supports elevation and time stamp data.
My wife and I went on a road trip from Florida to Massachusetts (and back) a couple of days ago to visit family. Obviously, the nerd in me asked for tracking the whole trip and storing it in a GPX file. The resulting GPX file was 12 MB large. It was collected for over 24 hours while driving through the United States.
Back home, I wanted to load the GPX data in one of my TMS FNC Maps examples that is part of my latest Hands-on books. The Windows desktop application loads a GPX file and draws it on a map. The user interface allows to select different map providers and to customize the style of the track that is drawn on the map.
Loading my file laid bare some issues. The file took about 10 seconds to load into memory and drawing on the map was only a matter of milliseconds. I could clearly identify the loading process as the bottleneck as changes to the style of the track were drawn instantly.
Unsatisfied with the result, I emailed TMS and asked what my options were to improve the loading. As the track contained nothing but my own personal information, I provided their R&D team with the GPX data.
A couple of days later, I was a very happy camper. Because I provided a very precise test case and also was able to provide data to reproduce the issue, TMS was able to optimize the GPX loading process. The 12 MB GPX data is now loaded into memory instantly! I already received a patch for testing and am amazed how smoothly it works now!
Summed up, I would like to express the following words of advice when support is needed. This does not only apply to TMS but also when writing bug reports for Delphi in Quality Portal:
- Provide steps to describe and reproduce the issue.
- With regards to the steps: Either provide a test project or start from scratch with a new project.
- Provide data or a selection of data. This is sometimes tough when it is confidential information, but every little bit helps.
- Always juxtapose what happens and what you expect to happen. This is sometimes not obvious.
- Screenshots! Sometimes pictures say more than a thousand words… Highlight important areas.
- If screenshots do not suffice, record a video.
- Try to reproduce the issue yourself using your own report … or hand them to a colleague. This usually uncovers gaps or might even resolve the issue as you notice a glitch.
In this case, I provided a short video showing the loading delay and also showed that the styling was applied immediately. TMS knew immediately where to approach the issue and was able to provide help within seconds. The best thing is that free support like this is included in any license you purchase from TMS software. You might either use email or their awesome forum.
For the record, here is the screenshot of our drive with the track from Massachusetts to Florida. I started tracking a bit too late when we were already crusing through Connecticut.

The application allows zooming in to a high level of detail:

If you want to learn more about TMS FNC Maps go here. My latest book is dedicated completely to FNC Maps. Information about it is available using the form below. No order is issued. You will just navigate to the product page on Amazon.