Discussion Forums  >  Maps, Device Location, Tracking

Replies: 15    Views: 330

SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
05/14/13 06:16 PM (11 years ago)

How To use offline maps using 'Route-Me' within the Buzztouch environment.

Having just upgraded my MacBook, I needed to setup some things to do offline maps in my projects again. This time, I did it while using Clarify, and (hopefully) created tutorials as I went along. It's a bit involved, setting up the pre-requisites to use offline maps, so I cut them up into several different 'modules'. From start to finish: Installing CPAN Perl modules: https://dl.dropboxusercontent.com/u/115208762/OSMBT/InstallPerlMac.pdf Installing the Map Tile Downloader script https://dl.dropboxusercontent.com/u/115208762/OSMBT/InstallMapTileDwnldr.pdf Building and compiling the map2sqlite project https://dl.dropboxusercontent.com/u/115208762/OSMBT/Map2SQLite.pdf Creating your Map Tile Database https://dl.dropboxusercontent.com/u/115208762/OSMBT/OSMTiles.pdf And finally, after all that, Integrating Offline Maps into your BT Project https://dl.dropboxusercontent.com/u/115208762/OSMBT/BT_RouteMe.pdf I'd appreciate any constructive criticism on this. Cheers! -- Smug Edit: This is not something for the unadventurous or unfamiliar. Xcode familiarity is a definite plus, and there most certainly is some assembly required.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
05/14/13 08:28 PM (11 years ago)
Whoa! Thanks a lot for giving me a weekend play assignment! :-) -- Niraj
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
05/14/13 09:06 PM (11 years ago)
A little off topic, but there was a tool on Hacker News recently for converting pdf to html. Its command line based, but its html output is a fairly accurate rendering of the pdf. https://news.ycombinator.com/item?id=4528797 http://coolwanglu.github.io/pdf2htmlEX/
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
05/14/13 09:29 PM (11 years ago)
What the heck, the weekend started early on a Tuesday night! :-) 1. I had to update my list of CPAN mirrors with the portals one shown in your screenshot. Otherwise, all the nearby mirrors were bogus. Go figure -- auto-detection failed. 2. The link in the Map Tile Downloader PDF has a space (%20) in it after the Geo- part Bad: https://dl.dropboxusercontent.com/u/115208762/OSMBT/Geo-%20OSM-Tiles-0.04.tar.gz Good: https://dl.dropboxusercontent.com/u/115208762/OSMBT/Geo-OSM-Tiles-0.04.tar.gz 3. From the "Building and compiling the map2sqlite project" PDF, there is a space (%20) in this link: Bad: https://dl.dropboxusercontent.com/u/115208762/OSMBT/%20map2sqlite-1.0.tar.bz2 Good: https://dl.dropboxusercontent.com/u/115208762/OSMBT/map2sqlite-1.0.tar.bz2 4. Launch of the Xcode project for the map2sqlite command line tool results in these warnings that I asked Xcode to automatically fix. You made a mention of it, perhaps list these items to help inform the Student on what to expect. - Obsolete build settings of GCC_ENABLE_FIX_AND_CONTINUE and of PREBINDING - Upgrade Base SDK configuration to latest Mac OS X to 10.8 from 10.5 - Upgrade project format from Xcode 3.1 to Xcode 3.2 compatibility 5. For the map tiles, let us know how to deal with negative Longitude and Latitude numbers and in which order to use them for the creation of the map tiles. 6. Whoa! Just saw the last PDF -- 28 pages! TIme for me to sleep, I will start the "Integrating Offline Maps into your BT Project" tomorrow. -- Niraj
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/14/13 11:54 PM (11 years ago)
Dang, this is a goldmine! I was literally thinking today about an app that would require offline maps...could this have been more timely? ROCK AND ROLL! Mark
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
05/15/13 02:06 AM (11 years ago)
Nice done SmugWimp!
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
05/15/13 03:40 AM (11 years ago)
That looks awesome! I need offline maps for sure
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
05/15/13 12:40 PM (11 years ago)
Amazing. Thanks for the great tutorial. Well done, will have to give it a try sometime. The notes on adding a second project to your project are great. Reminds me of when I was using the Tapku class. It got tricky dealing with build settings for 2 projects. I've been playing with the MKPolyline and the MKOverlay classes lately and they are fun.
 
nickrick32
Apple Fan
Profile
Posts: 111
Reg: Feb 28, 2011
location unknow...
1,110
like
05/27/13 05:06 AM (11 years ago)
Great tutorial, is there a way to include multiple locations from database or csv (10-10000 locations)? thx
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/27/13 02:10 PM (11 years ago)
Well, you'd add other locations within the code... I haven't gotten that far yet. Basically you're going to need a list of locations, those will go into an array. Then you take the array and loop it through the marker placement code, to place a marker at each array item location. But again, I haven't gotten that far, so I'm not entirely sure how yet, other than the code I've gotten to work so far... As it goes, I will document more. Cheers! -- Smug
 
nickrick32
Apple Fan
Profile
Posts: 111
Reg: Feb 28, 2011
location unknow...
1,110
like
05/28/13 01:42 AM (11 years ago)
Great Smug, I will wait for your tutorial :)
 
juk
Aspiring developer
Profile
Posts: 29
Reg: Feb 16, 2014
York, UK
890
like
05/04/14 05:09 AM (10 years ago)
Hi Smug This set of tutorials was brilliant, thank you. Typically however, it all went fine until the very last page of the very last document! The Australian default map showed fine on my phone, etc, it was only when I set it to my own tiles db that I started getting problems. So this is a cry for help but may also be useful information for others. The suggested viewDidLoad code resulted in several errors: autorelease is unavailable: not available in automatic reference counting module ARC forbids explicit message send of autorelease The suggestion I found when searching for this error was to go to my project's targets > build phases > compile sources. I then set the compiler flags for BT_screen_blank to "-fno-objc-arc". So that seemed to allow the code to compile at least (I realise that doesn't necessarily mean it was the correct thing to do!) However, when I now try to open the screen on my phone the app just hangs when I try to open the map screen. Does anyone have any suggestions please? Frustrating to have come this far and it feels so close! Thanks James
 
juk
Aspiring developer
Profile
Posts: 29
Reg: Feb 16, 2014
York, UK
890
like
05/04/14 05:50 AM (10 years ago)
Ah, think I've just fixed it. Worth mentioning in case anyone else has the same problem... My tiles.db file had not automatically been included in the Copy Bundle Resources list, so I guess the app was failing to find the required table, etc. To fix this, go to your project (top node in the Project Navigator), then to Targets > Build Phases > Copy Bundle Resources. If you can't see tiles.db in the list, click the plus at the bottom to add it. Map seems to be working so thanks again Smug. I was a bit nervous about even trying this but actually, with your instructions, it's pretty straight-forward - everything's included in your docs. Reckon it took me 2-3 hours so set up all in all and I'm no expert. I now need to figure out how to include markers, current location, etc, on the map, if possible. Have you found out any more on this since the documentation was written? Thanks.
 
juk
Aspiring developer
Profile
Posts: 29
Reg: Feb 16, 2014
York, UK
890
like
05/04/14 10:02 AM (10 years ago)
Tried it the newer way now... Probably worth me mentioning on this post that an improved method is detailed here: http://www.buzztouch.com/forum/thread.php?tid=B9F890208160CCEBD169D95&fid=0B19EC7C02CBDD92F12FD08&sortColumn=FT.id&sortUpDown=DESC&currentPage=1
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/07/14 10:12 AM (10 years ago)
I prefer the Alpstein fork as well. Sorry for the late reply, I just got back from a vacation that kept me off the internet. I'm pretty happy about that. Can you imagine a week without email? It's bliss :) You're correct: The original 'route-me' fork should be used in BTv2 projects. (non ARC) The 'Alpstein fork' should be used in BTv3 projects. (using ARC) I'm working on a plugin that will allow offline maps, however it's based on all these tutorials, so if you get it working the way you want, you may not need to purchase anything. On the other hand, you might be interested because it also includes Android, and the capability of using the same map 'source' to create your map databases (sorry, Android and iOS use different SQLite database formats. Grr!) Happy to see it working for you, If you get stuck, give me a yell (via the forum, so that others can see what we're working with too). Cheers! -- Smug
 
Jan88
Aspiring developer
Profile
Posts: 9
Reg: May 17, 2014
Bangkok
3,240
like
05/22/14 08:14 AM (10 years ago)
Just want to say thank you Smug. Your tutorial is fantastic. I'm really looking forward to your plugin though, since I want to create a similar user experience to Android and iOS users. It sounds like the must have plugin for my location based app and could very well become my first paid plugin. Hope it is finished soon. Thank you again for the great work!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.