Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 10    Views: 101

LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
05/08/14 05:17 AM (9 years ago)

Location Map Android/IOS Bugs

Hey there, just wanted to let the admins know, that the driving directions are not shown anymore in Android 3.0, self hosted. Seems like the same with IOS. If you enter the latitude/longitude, title and subtitle and select " show driving directions" as action all seems fine. As soon as you hit save, leave the screen and go back again, the tapping screen will say: "Does nothing" instead of the driving directions. On another note, the single location zoom does not work at all. Hope someone can figure it out.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
05/08/14 07:30 AM (9 years ago)
I have the same problem. I can't figure it out either, but I have reported it as a bug on buzz-tools.com. Alan
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/09/14 06:38 AM (9 years ago)
I can figure it out. I'm working on a plugin that mimics the BT_screen_map plugin, but with offline maps. Since all features (except map type) needed to be duplicated, I pored over the methods to be able to translate those needed to accomodate my maps. There are some slight changes in the way BTv3 delivers JSON to the plugin. However, the plugin isn't erroring out because there isn't a 'syntax' error, it's just some JSON key/value pairs have changed, and the changes weren't migrated to the plugin. I'll let Chris know of the changes so he can cover the BT Hosted crowd. For the 'Do it Yourself-ers' Look at some sample JSON for a BT_screen_map, using Driving directions for one, and load another screen for the other: { "itemId": "82EC8B63A4568AC67124E12", "itemType": "BT_locationItem", "title": "Mom's House", "subTitle": "Over there somewhere", "latitude": "13.5002", "longitude": "144.8003", "calloutTapChoice": "showDirections", "transitionType": "flip", "pinColor": "green" }, { "itemId": "41BC6D5873C6A74F10CCAAD", "itemType": "BT_locationItem", "loadScreenWithItemId": "C129B5130DD815741E53944", "title": "Another Place", "subTitle": "128 Marine Corps Drive Tamuning Guam", "latitude": "13.5002798", "longitude": "144.7999226", "calloutTapChoice": "loadAnotherScreen", "loadScreenNickname": "Offline Map", "pinColor": "purple" } In the BT_screen_map code, and in older versions of BT, the 'loadScreenByItemId' key/value pair would either have the itemId of the destination screen, or it would say "showDirections" (or it would have a loadScreenObject line, but that doesn't matter here). the BT innards would look for the 'showDirections' keyword, or an itemID, or neither, and direct or ignore as needed. Well, the code is still looking for 'loadScreenById', and if it sees one, it's all good. But it'll never see 'showDirections' because that value has been moved to the key 'calloutTapChoice' which is not implemented (yet) in either Android or iOS plugins. for Android: without adding a new line, on line 104 add this: public String calloutTapChoice = ""; this gives us a place to put our newly found json key/value. without adding a new line, on line 218 add this: calloutTapChoice = BT_strings.getJsonPropertyValue(this.screenData.getJsonObject(), calloutTapChoice, ""); this populates the calloutTapChoice value from the BT Control Panel Screen configuration value. On line 632 change the line from this: if(loadScreenWithItemId.equalsIgnoreCase("showDirections")){ to this: if(calloutTapChoice.equalsIgnoreCase("showDirections")){ this just shows or hides the details button depending on follow up action. On line 670 change the line from this: if(loadScreenWithItemId.equalsIgnoreCase("showDirections")){ to this: if(calloutTapChoice.equalsIgnoreCase("showDirections")){ this corrects the erroneous ignoring of map directions stuff. Now, just under that, paste the following: //do we show details button? if(calloutTapChoice.equalsIgnoreCase("loadAnotherScreen")){ myAlert.setButton(getString(R.string.details), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { myAlert.dismiss(); showDetailsScreen(markerIndex); } }); } this is a new 'if' to catch the calloutTapChoice in the event it wants to load another screen. Once all of this is done, and you've had no errors, I would 'suggest' either commenting out, or removing the legacy code from lines 660-667. It should still work, but it's always good to remove duplicate functions, regardless of however 'seemingly' harmless. I prefer to comment out code rather than remove it… It's up to you. And I 'think' that's it for android. Let me know if I forgot something. for iOS: On line 741 change this line: if([[tappedLocation.jsonVars objectForKey:@"loadScreenWithItemId"] isEqualToString:@"showDirections"]){ to this line: if([[tappedLocation.jsonVars objectForKey:@"calloutTapChoice"] isEqualToString:@"showDirections"]){ and I 'think' that's that for iOS too. Let me know if things are still funky, but that should clean up a bit. Hope this helps! Cheers! -- Smug
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
05/09/14 07:40 AM (9 years ago)
Wow thx Smug, just implemented it with out errors on Android. Will have to wait if it works as soon as my app is live in the pLayStore (Yes only use 1 distribution map api ;-) ). 2 bugs left ;-) Location zoom and the more annoying one: If I am in my map screen and click my tab bar "map" again, the app immediately crashes. Any good ideas here maybe?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/09/14 07:23 PM (9 years ago)
I might have; I'll have to look honestly. I sorta quit working on things just before Vegas, and am not trying to remember my cat's name now that I'm back. Once I get completely cognizant of my surroundings, I'll start back in on it. If I find something, I'll let you know. Cheers! -- Smug PS, so far, the only real 'problems' have been small details that slipped through the cracks. Whatever the resulting issue is, the problem can't be all that bad. Just a deprecated call or a forgotten variable...
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
05/11/14 07:45 AM (9 years ago)
Unfortunately it does not work for Android (didn't check for IOS yet), still no Directions button :( IS this not a control panel issue? Still says "does nothing" as soon as you save a location with show directions. Sad sad sad :(
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
05/11/14 01:48 PM (9 years ago)
If it is an CP issue and/or a json issue, would it be feasible to load valid json from a remote file location?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/11/14 01:56 PM (9 years ago)
For the screen map? absolutely. External childItem files (in my humble opinion) is the only way to go. It's possible I've missed a step in my instructions; but the maps for for me… So I'll look again in a few and see if I forgot to post some small innocent but very meaningful details. Cheers! -- Smug
 
Doug
Aspiring developer
Profile
Posts: 3
Reg: May 09, 2014
Los Angeles, CA
2,130
like
05/13/14 09:29 AM (9 years ago)
Great thread; the Android code updates are not working for me, either.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
06/01/14 05:19 PM (9 years ago)
If we're talking about the same basic Map Plugin: https://www.buzztouch.com/plugins/plugin.php?pid=9E669EFC6F081CA47A33877 The instruction for Google Map key is a year and a half outdated. Note: Version 1 of the Google Maps Android API has been officially deprecated as of December 3rd, 2012. This means that from March 18th, 2013 you will no longer be able to request an API key for this version. No new features will be added to Google Maps Android API v1. However, apps using v1 will continue to work on devices. Existing and new developers are encouraged to use Google Maps Android API v2. My Android App with the Map plugin seems to be working fine.
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
06/02/14 01:09 AM (9 years ago)
Sure it works fine for you, but not on BT 3.0, so obviously you use the older version
 

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.