Discussion Forums  >  Maps, Device Location, Tracking

Replies: 20    Views: 325

AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
06/02/14 05:07 AM (9 years ago)

Map with Driving instructions - Work-Around

I've just worked out that the reason that the driving instructions for BT3.0 maps don't work is a fault of the Buzztouch control panel, not the plug-in itself! I don't know how to fix the control panel, but I do have a functioning work-around. The work-around is to create a text file with the map json information and load it to your Files/Media > Documents area of your control panel and load it. To load the text file into the plug-in, first you need to work out the URL of your text file. You can do that by clicking on the link for it in the Files/Media section. Then, in the Location plug-in control panel > Screen Data URL, enter that URL. Now, the plugin will load the map info from your text file instead of the control panel - voila! You can create the text content for you json by hand crafting using my example, or you can cut and paste the relevant map info from you apps config.txt and make sure the json pair "loadScreenWithItemId": "showDirections", is in each location child item. Enjoy! Example text file content: { "childItems": [ { "itemId": "A9FD53B0AE12D3E5F9FD348", "itemType": "BT_locationItem", "loadScreenWithItemId": "showDirections", "title": "Brasilia", "subTitle": "Estadio Nacional de Brasilia", "latitude": "-15.783839", "longitude": "-47.897319" }, { "itemId": "83595522CD45054DFE6A1DF", "itemType": "BT_locationItem", "loadScreenWithItemId": "showDirections", "title": "Maracana", "subTitle": "Rio de Janeiro", "latitude": "-22.912107", "longitude": "-43.230155" } ] }
 
krompa
Lost but trying
Profile
Posts: 257
Reg: Jun 14, 2013
Bristol
8,820
like
06/02/14 05:30 AM (9 years ago)
Great workaround Alan. As a fellow Englishman - we won't be needing driving directions to the Maracana though. Maybe 2nd round if we get lucky.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
06/02/14 05:54 AM (9 years ago)
Mighty nice! Good sleuthing! -- Niraj
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/02/14 06:46 AM (9 years ago)
Just for giggles, to make your workaround 'compliant' for the future you may want to also add a new JSON key/value pair... "calloutTapChoice": "loadAnotherScreen" or "calloutTapChoice": "showDirections" If the code eventually calls for it, it's there. If it doesn't, it'll ignore it. Better safe than sorry. Cheers! -- Smug
 
trouty
I hate code!
Profile
Posts: 338
Reg: Mar 26, 2013
London Outskirt...
4,830
like
06/02/14 09:01 AM (9 years ago)
Excellent! The only thing that i can think of, is if the file is in your CP, will Joe Bloggs user still be able to view it? Would the text file be better hosted somewhere else? I really need to save this one for future reference :)
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/02/14 10:30 AM (9 years ago)
@Niraj, thanks, I just had a hunch, it panned out. @Smug, Good to know. I spotted those in the json, but I removed it. @Trouty, I find it is simple & convenient to put the text file in the project somewhere, but you can save the text file anywhere you like, it will work if the URL resolves. @krompa, you're probably right, but you can track it on my latest app!
 
travissickle
Lost but trying
Profile
Posts: 9
Reg: May 29, 2014
Tampa
1,790
like
06/02/14 06:45 PM (9 years ago)
I tried this workaround but must be doing something wrong. This is my edited code I put into a text file. { "childItems": [ { "itemId": "AF3EECA7942CEA71E03FB77", "itemType": "BT_locationItem", "loadScreenWithItemId": "showDirections", "title": “Sickle Hunter Financial Advisors”, "subTitle": “511 W Bay Street Suite 350 Tampa FL 33606”, "latitude": "27.938402”, "longitude": "-82.464759" }, ] } I uploaded it to the file media section under documents and used this URL https://www.buzztouch.com/applications010914/JA6EEB92B1CAC6078BA24B07A/documents/itemId.txt then I placed the above URL to "Screen Data URL" section on the maps I then clicked on publish. The error I get is "There was a problem parsing some JSON data. Please make sure that it is well-formed." I have no idea what this means or how to fix it. Anyone have any idea what I'm doing wrong?
 
travissickle
Lost but trying
Profile
Posts: 9
Reg: May 29, 2014
Tampa
1,790
like
06/02/14 07:44 PM (9 years ago)
I don't know why, but this seemed to work for me. and if I take out the last line, it doesn't work. I don't know much about this stuff but I thought I'd post for anyone who is having trouble. "calloutTapChoice":"showDirections" { "childItems":[ { "itemId":"0AA557C9B3B871BFB137B01", "itemType":"BT_locationItem", "loadScreenWithItemId": "showDirections", "title":"Sickle Hunter Financial Advisors", "subTitle":"511 W Bay Street Suite 350 Tampa FL 33606", "latitude":"27.938402", "longitude":"-82.464759", "calloutTapChoice":"showDirections" } ] }
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/02/14 08:02 PM (9 years ago)
I've been meaning to take a good look at the plugin, but I just haven't had time yet... But the plugin is in what "I" would call a 'transitional phase'... The 'old school' method was to have 'showDirections', or the ItemId of the next screen, in the 'loadScreenWithItemId' key... With the 'new' version of BT_screen_map (Location Map) they introduced a new key/value pair called 'calloutTapChoice'. So, the way it's 'supposed' to work is, 'loadScreenWithItemId' will 'only' hold the ItemId (that long cryptic alphanumeric string) for the next screen to load, or will be blank, if no screen is needed. The thing is, until the plugin is straightened out (both plugin code and control panel) you're probably best off using 'both' key/value pairs... again, if they fix the plugin you'll be ready. If not, things may not work 'as expected'. Cheers! -- Smug
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/03/14 12:54 AM (9 years ago)
@travissicle, I know why, json syntax; the comma on the third line from the bottom should not be there. Smugs advice sounds like best practice going forward, I will add that in future. Interestingly enough, the control panel sometimes adds that calloutTapChoice json and sometimes does not.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/03/14 02:49 AM (9 years ago)
@Alanmac: I know right? intermittancy seems odd to me... I'm a 0 and 1 kinda guy... @travissicle: AlanMac is right; json is (you can go deeper, but simply put) a group of key/value pairs, separated by commas. The last key/value line isn't a separation, so it needs no comma at the end. If you were to remove the line with 'calloutTapChoice', then 'longitude' would be the last key/value pair, and no 'comma' should be at the end of it. Cheers! -- Smug
 
trouty
I hate code!
Profile
Posts: 338
Reg: Mar 26, 2013
London Outskirt...
4,830
like
06/09/14 04:44 AM (9 years ago)
{ "childItems": [ { "itemId":50000001, "itemType":"BT_locationItem", "loadscreenWithItemId":"showDirections", "navBarTitleText":"Croft", "subTitle":"Get Directions", "latitude":54.4545349, "longitude":-1.5573254, "showUserLocation":"1", "showUserLocationButton":"1", "defaultMapType":"standard", "singleLocationDefaultZoom":5, "backgroundColor":"#ffffff" } ] }
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
06/09/14 07:59 AM (9 years ago)
Susan updated the plugin with a fix a few days ago. Can one of you give it a test drive? Thanks, -- Niraj
 
feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
like
06/28/14 02:36 PM (9 years ago)
Ok i tested in works great! The json child items must look like this { "itemId": "E4GQ824JD5", "itemType": "BT_mapLocation", "latitude": "40.750589", "longitude": "-73.993692", "title": "Penn Station", "subTitle": "34th Street between 7th & 8th Avenues  ", "pinColor": "red", "transitionType": "fade", "calloutTapChoice": "showDirections" } Thank god you posted this i thought i was going crazy again!
 
Caslor
Android Fan
Profile
Posts: 191
Reg: Jul 26, 2013
athens
1,910
like
11/03/14 01:19 PM (9 years ago)
Self hosted BT.3 i run my simple project application (android) and still i have the problem. i installed the app in my device and i can see the map and my location but cant see any of the points i have entered in my control panel ''{"itemId":"D43AF7D17AD739537774BD2", "itemType":"BT_screen_map", "itemNickname":"mapme", "itemId":"D43AF7D17AD739537774BD2", "itemType":"BT_screen_map", "itemNickname":"mapme", "navBarTitleText":"mapme", "showUserLocation":"1", "showUserLocationButton":"1", "defaultMapType":"standard", "showMapTypeButtons":"1", "singleLocationDefaultZoom":"15", "childItems":[ {"itemId":"261B295F0BD96701BB55234", "itemType":"BT_locationItem", "title":"Poustis", "latitude":"37.999055", "longitude":"23.740145", "calloutTapChoice":"showDirections", "pinColor":"red"}, {"itemId":"8844C2DA77E9699FE7DEDF5", "itemType":"BT_locationItem", "loadScreenWithItemId":"9370B4F196B1681BB5C2D84", "title":"gamikoulas", "latitude":"37.810490", "longitude":"22.140503", "calloutTapChoice":"loadAnotherScreen", "loadScreenNickname":"Homie", "pinColor":"green"} ]}
 
Caslor
Android Fan
Profile
Posts: 191
Reg: Jul 26, 2013
athens
1,910
like
11/11/14 08:35 AM (9 years ago)
Ok i manage to make my maps to work with the help of this post i have one problem with that solution when i open the map in my app the notification tha says ''loading'' is always on it stops only when i press the return button in my android device why ? and my debug log loop again and again on this : 11-11 17:23:51.179: V/Sensors(454): int poll__activate(sensors_poll_device_t*, int, int) 11-11 17:23:51.179: V/Sensors(454): int sensors_poll_context_t::activate(int, int) 11-11 17:23:51.179: D/Sensors(454): Sensor_enable:0 0 11-11 17:23:51.179: V/Sensors(454): enable - sensor RotationVector (handle 0) en -> dis 11-11 17:23:51.179: V/Sensors(454): enabled_sensors: 16 dmp_started: 1 11-11 17:23:51.179: W/ZZ(10384): BT_strings:getSaveAsFileNameFromURL from: "http://i30.photobucket.com/albums/c316/caslor_1978/diafora/application/a1_zps165c9972.png" file name: "a1_zps165c9972.png" 11-11 17:23:51.179: I/Sensors(454): Disabled 9 axis sensor fusion 11-11 17:23:51.189: I/MPL-mldl_cfg_mpu:(454): inv_mpu_suspend(,,,,7fff) -> 0000 11-11 17:23:51.189: V/Sensors(454): calling inv_set_mpu_sensors(000070) 11-11 17:23:51.189: I/MPL-fifo(454): Actual ODR: 50000 mHz 11-11 17:23:51.189: V/Sensors(454): Starting DMP 11-11 17:23:51.189: W/MPL-9_sup(454): 9 axis sensor fusion not available - No compass detected. 11-11 17:23:51.189: I/Sensors(454): Enabled 9 axis sensor fusion 11-11 17:23:51.209: I/MPL-mldl_cfg_mpu:(454): inv_mpu_resume(,,,,0070) -> 0070 11-11 17:23:51.209: V/Sensors(454): set fifo rate - divider : 3, delay : 20 ms (50.00 Hz) 11-11 17:23:51.209: W/ZZ(10384): BT_screen_menuButtons:GetButtonImageWorkerThread using image from cache: "a1_zps165c9972.png" 11-11 17:23:51.209: I/MPL-mldl_cfg_mpu:(454): inv_mpu_suspend(,,,,7fff) -> 0000 11-11 17:23:51.219: I/MPL-fifo(454): Actual ODR: 50000 mHz 11-11 17:23:51.239: I/MPL-mldl_cfg_mpu:(454): inv_mpu_resume(,,,,0070) -> 0070 11-11 17:23:51.239: V/Sensors(454): int poll__setDelay(sensors_poll_device_t*, int, int64_t) 11-11 17:23:51.239: V/Sensors(454): int sensors_poll_context_t::setDelay(int, int64_t) 11-11 17:23:51.239: V/Sensors(454): setDelay - sensor RotationVector (handle 0), rate 200 ms (5.00 Hz) 11-11 17:23:51.249: W/ZZ(10384): BT_strings:getSaveAsFileNameFromURL from: "http://i30.photobucket.com/albums/c316/caslor_1978/diafora/application/del2_zpsc54cb533.png" file name: "del2_zpsc54cb533.png" 11-11 17:23:51.259: W/ZZ(10384): BT_screen_menuButtons:GetButtonImageWorkerThread using image from cache: "del2_zpsc54cb533.png"
 
Summer Weather
Aspiring developer
Profile
Posts: 18
Reg: Nov 18, 2011
Newport Beach, ...
1,280
like
12/27/14 03:46 PM (9 years ago)
Hello All, My goal is to create an iOS and Android app from just creating the one control panel in Buzztouch. The iOS map works perfectly. I'm getting close to getting the Android map to work. However, I feel that the closer I get to getting the Android map working from using the url method, the further away I get from keeping my iOS app working. Is it possible to make both apps work well with this plugin? I'm surprised I've gotten as far as I have, thanks to all your help in these forums. Here is what I have saved in my .txt file that I'm uploading in the Screen Data URL section. { "childItems": [ { "itemId": "C053B86B8BBF63B8491132F", "itemType": "BT_locationItem", "loadScreenWithItemId": "showDirections", "title": "Maracana", "subTitle": "Rio de Janeiro", "latitude": "33.675732", "longitude": "-118.003016" } ] } I've noticed that if I change Maracana or Rio de Janeiro, the map will not zoom in to the lat & long I've specified. I changed the itemID to what was in my JSON Configuration Data section. Also, The spinning arrow doesn't go away when I load this screen. If I hit the arrow back button, The app works fine. Also, It zooms in a little close to my coordinates. I wonder if there is a way to fix that.
 
Summer Weather
Aspiring developer
Profile
Posts: 18
Reg: Nov 18, 2011
Newport Beach, ...
1,280
like
12/27/14 04:01 PM (9 years ago)
I've also tried this from the information located in the plug-in details section: *I swapped out my itemID, Nickname, Title, and lat,long info. { "itemId":"C053B86B8BBF63B8491132F", "itemType":"BT_screen_map", "itemNickname”:”Directions”, "navBarTitleText”:”Directions”, "childItems":[ { "itemId":"loc_1", "itemType":"BT_locationItem", "title”:”HBHS”, "subTitle”:”1905 Main Street”, "latitude":"33.675732", "longitude":"-118.003016" }, { "itemId":"loc_2", "itemType":"BT_locationItem", "title":"Another Restaurant", "subTitle":"1234 Main Street Anytown CA", "latitude":"38.4223", "longitude":"-121.5645" } ] }
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
12/27/14 04:03 PM (9 years ago)
you need a json key/value pair that says "calloutTapChoice":"showDirections" To get your directions working. Refresh your data often, so that you can be sure the changes you've made have been implemented in the device. This is true especially for Android, which doesn't seem to refresh as often as it should. Cheers! -- Smug
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
12/27/14 11:26 PM (9 years ago)
If self-hosting, be sure to update the plugin on your Server to get the latest version. The Android side of the plugin was updated recently. -- Niraj
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
12/28/14 04:56 AM (9 years ago)
I just thought I'd revisit this to make sure it all still works. The following is an excerpt from a remote map text file that incorporates the added json @Smug mentioned. I've tested it on android and apple, its OK on both, with a couple of small caveats. The apple map doesn't support the pin color blue and the android version has a 'loading' dialog that won't go away on first load, but no problems once it is cached. Here is a working json file with two map items { "childItems": [ { "itemId": "C512F0BF35E50618E3ADB2A", "itemType": "BT_locationItem", "loadScreenWithItemId": "DC4E6FC96D9CA39A53DBC09", "title": "R1 - Australia", "subTitle": "Melbourne F1 Circuit, Albert Park", "latitude": "-37.7041506", "longitude": "144.7883236", "calloutTapChoice": "loadAnotherScreen", "loadScreenNickname": "01-Australia", "pinColor": "blue" }, { "itemId": "BAA2A94F1732514AC729294", "itemType": "BT_locationItem", "loadScreenWithItemId": "40FECDAC4D00CABA7198E42", "title": "R21 - Abu Dhabi", "subTitle": "Yas Marina Circuit", "latitude": "24.4775603", "longitude": "54.6072678", "calloutTapChoice": "loadAnotherScreen", "loadScreenNickname": "21-AbuDhabi", "pinColor": "blue" } ] } If you want to check out the app to see the map in action loading the text file, check out the android version - https://play.google.com/store/apps/details?id=com.gpracefanf&hl=en or the apple version - https://itunes.apple.com/gb/app/the-gp-race-fan-app-free/id497967317?mt=8
 

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.