This map stuff has been really difficult. I’ve made a lot of progress, but it’s still not quite there yet.
My remaining tasks are:
- Intelligently nullify tiles when applying centering
- Fix bug where zooming causes map data to go out of sync if the zoom has caused a change of tile value
- Implement separate async loading for peripheral, above and below tiles
- Remove ‘fullyAsync’ from DownloadImageTask()
- Implement directional async loading
- If no direction (on start-up or zoom in/out), then attempt to async load ALL peripheral tiles
- Apply lock on screen render if refresh already in progress
- Fix auto-centre functionality
- Get map data to fit GPS data
- Possibly remove movement lock in onTouch()
That looks about right.
I’ve continued to make progress with the map stuff, and hopefully I will have all functionality essentially finished by the end of the weekend.
My tasks tonight/tomorrow are:
- Rename startLocation to homeLocation, and make it unchanging (unless explicitly set/reset)
- Kill off all onTouch() events while updateMapBitmap()/loading in progress
- Find useful ‘n’ value and implement it
- Fix centering/auto-centering
- Fix bug where wrong images are loaded in when no connection available
- Implement toggle between true projection and alternate projection (to match map shape)
- Implement 4-tile max rendering
That should pretty much wrap up the main part of the map stuff. Obviously there will be more subtle issues, like how the actual curvature of the Earth affects values etc. But I’m confident that things are going my way here. Good times.
I’m quite happy with the stuff I’ve done for MTGPS lately. I’ve sorted out the Google API stuff, so I’m okay to get plenty of static map images, I’ve implemented a temporary caching of images to reduce load time (and number of requests to map API), I’ve fixed it so the correct tiles get loaded in the correct place (by putting a lock on during loading), and I’ve implemented the switching of terrain types.
Gonna take a little break for a day or so, but when I get back to it I will be sorting out the following:
- When switching zoom levels, clear the tileHashMap
- To avoid having to clear the entire cache with “Reload Map”
- Remove “Loading…” from the screen immediately after loading is finished
- Basically, an immediate call to refresh
- Implement numbers-only keyboard
- Implement “set start location”
- Figure out zoomConstant ‘n’
- viewRectWidth = n x gpsZoomValue x kmPerSquare
- Fully implement zoom level switching
So I will hopefully have a properly scaled and accurately anchored map system to go underneath my plotted GPS data soon.
And then I can really begin to build something big.
Right, I fixed that little bug last night and now I’ve got some kind of map data coming in (although it’s not quite right yet), so tonight’s – or this weekend’s – plan is as follows:
- Render tileDiffPoint coords values and tileIndex values at the centre of each tile, if debugModeOn
- Confirm “add km” method works
- When zooming in/out, make sure vcp alters correctly, just like cp already does
- BONUS STUFF
- Solve the “incorrect map tiles” issue, if possible
- Add sounds into app
I have also had a quick review of the GUI, and come up with a rough idea of how the improvements will go. I will make these ideas more formal in the coming days, but there should be some good changes implemented soon.
Also, at some point, I will need to have a look at preventing updating tiles from flickering. That could quite quickly become annoying. Maybe if I just use a “tileUpdateInProgress” boolean that prevents any screen drawing until complete?
Anyway, fuck off.
I made some decent progress with MTGPS last night, put the “add km” method in, implemented semi-persistent storage (well, at least the reload part works), and did some work on centering the map properly.
Once I made an .apk and stuck it on my HTC One, though, I got a null pointer error (which didn’t occur on the Samsung) – just as my laptop was shutting down and it was too late to fix. Bastard.
So tonight I’m gonna do a quick fix, sorting this out, and then assess what the current state of the maps stuff is. I could be really close to having it sorted, I could be a few thousand miles away. Can’t tell yet.
So that’s me.
Okay, I’ve come up with a shortlist of tasks that I will be looking to complete, with regards to the map implementation in MTGPS, in the next week or so:
- Implement the “add km to GPS point” method
- (Semi) persistent storage
- Centering (including constant auto-centering)
- Tile rendering efficiency implementation (max. 4)
Once this is done, the final – and probably most difficult task – will be to accurately map the scale of the rendered GPS points etc. to the scale of the view rect(s), and correctly choose when to switch map zoom value.
Might take a fair bit of hackery, trickery and fuckery to get it all working. Nae bother though 🙂 ’twill be awesome when complete.
Aside from that, there are some urgently required GUI improvements before I release v2.0, and of course I still need to get to grips with ProGuard. But enough of that. Romeo done.
I’ve just done a quick proof-of-concept for adding distance to a GPSPoint, so I’ll be implementing this properly tonight. Let’s just hope our internet is back on so I can actually get some maps!