Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 6    Views: 62

PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
10/08/13 11:50 PM (10 years ago)

loadScreenObject works on one menu item but not another?

Hi folks, looking for some help to see what's wrong here. I'm playing with the loadScreenObject parameter to eventually have it load dynamically generated JSON data when I click a map callout button. But for now, baby steps. At @Smug's suggestion, I've made a 'hard-coded" connection in a menu just so I can see what loadScreenObject looks like in the config file. I have it structured like this: BT_screen_menuListSimple menu item 1: BT_menuItem --> BT_screen_settingsLogIn (ie a menu item that takes the user to a sign-up screen); menu item 2: BT_menuItem --> BT_screen_map (this menu item generates pins on a map using data pulled via php from a MySQL database.. this works fine as far as loading pins and seeing annotations after the pins are tapped (thanks @Chris1 and @Smug). However there is no tappable arrow/button visible on the annotation box, which I suspect has something to do with my challenge below); menu item 3: BT_menuItem (this is where I've manually added a loadScreenObject parameter to the menu item so that it calls a URL, as follows: "loadScreenObject":{"itemId":"C45180DBF235795DBBC1BDD","titleText":"Testing the loadScreenObject thing" , "transitionType":"flip" }]}, and then the reference to the item with the above id, which is a customURL screen: {"itemId":"C45180DBF235795DBBC1BDD", "itemType":"BT_screen_customURL", "itemNickname":"Testing_NP_web", "navBarTitleText":"Testing_NP_web", "navBarStyle":"transparent", "dataURL":"http://www.website.com", "showBrowserBarBack":"0", "showBrowserBarRefresh":"1", "showBrowserBarLaunchInNativeApp":"1", "showBrowserBarEmailDocument":"1", "forceRefresh":"1", "dataDetectorType":"0", "preventAllScrolling":"0", "hideVerticalScrollBar":"1", "hideHorizontalScrollBar":"1", "preventScrollBounce":"0", "preventUserInteraction":"0", "loginRequired":"0"}, Menu item 3 works well - it brings up the remote URL no problems, it functions nicely. (I know that this is an inelegant way to call up a customURL but I'm doing this to learn how these things work; it's the loadScreenObject parameter that I'm focusing on.) My challenge is this: when I take the same loadScreenObject from menu item 3 and instead put it into BT_config.txt for menu item 2 ( BT_menuItem --> BT_screen_map), I get nothing. What I expected to have happen was that, regadless of which annotation bubble I tapped, they would all just take me to the URL that loadScreenObject is specifying. Any thoughts greatly appreciated. I'm especially curious to know whether it might be the lack of a tappable button on the call out bubble that might be the hurdle (and if so, how do I get it to appear there manually?), or whether it's the way I've placed the loadScreenObject that is preventing that arrow/icon from appearing in the map callout bubble in the first place. Cheers Paddy.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
10/09/13 11:03 PM (10 years ago)
Can you paste your JSON with the loadScreenObject added into #2?
 
PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
like
10/10/13 03:08 PM (10 years ago)
Thanks Chris, here's the JSON: {"itemId":"2FCE8AD101DBEDB5D5C33F8", "itemType":"BT_screen_map", "itemNickname":"Mymap", "navBarTitleText":"Mymap", "navBarBackgroundColor":"#33CCCC", "navBarStyle":"solid", "navBarRightButtonType":"refresh", "showUserLocation":"0", "showUserLocationButton":"1", "defaultMapType":"standard", "showMapTypeButtons":"1", "showRefreshButton":"1", "singleLocationDefaultZoom":"8", "dataURL":"http://www.noshplanet.com/full2.php", "loadScreenObject":{"itemId":"C45180DBF235795DBBC1BDD", "itemType":"BT_screen_customURL", "itemNickname":"Testing_NP_web", "navBarTitleText":"Testing_NP_web", "navBarStyle":"transparent", "dataURL":"http://www.noshplanet.com/index.php", "showBrowserBarBack":"0", "showBrowserBarRefresh":"1", "showBrowserBarLaunchInNativeApp":"1", "showBrowserBarEmailDocument":"1", "forceRefresh":"1", "dataDetectorType":"0", "preventAllScrolling":"0", "hideVerticalScrollBar":"1", "hideHorizontalScrollBar":"1", "preventScrollBounce":"0", "preventUserInteraction":"0", "loginRequired":"0"}, "childItems":[]},
 
PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
like
10/13/13 07:53 PM (10 years ago)
Just to keep a record of what I'm trying: I wondered whether it might have been the very long sub-title on the callout button that was preventing a 'next' arrow being displayed... so I removed some of the database fields from the php file to 'shrink' the output, but it seems all that did was shrink the callout bubble. Still no arrow button. :(
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
10/13/13 09:58 PM (10 years ago)
I think your json looks ok, but it may not be the right (or all of the right) json variables... I had a project that only used a couple of pins, so it was all in the control panel. The json looked like this: { "itemId": "DEB9F126BB3DBE69894AD11", "itemType": "BT_mapLocation", "latitude": "13.504370", "longitude": "144.821209", "title": "Todays Realty", "subTitle": "1700 Army Drive Suite 101 Dededo GU 96929", "loadScreenWithItemId": "showDirections" } The part that allowed them to 'get directions' was the "loadScreenWithItemId":"showDirections" json parameter which is a special trigger in the Map Plugin Code... If you're not using 'that' in your callout json, it's not going to show. Cheers! -- Smug
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
10/13/13 09:59 PM (10 years ago)
I may not understand what you're looking for... Are you trying to launch a customURL from the callout, or are you trying to launch Directions? If you're trying to do a customURL, then something like this might work... { "itemId": "DEB9F126BB3DBE69894AD11", "itemType": "BT_mapLocation", "latitude": "13.504370", "longitude": "144.821209", "title": "Todays Realty", "subTitle": "1700 Army Drive Suite 101 Dededo GU 96929", "loadScreenObject":{"itemId":"C45180DBF235795DBBC1BDD", "itemType":"BT_screen_customURL", "itemNickname":"Testing_NP_web", "navBarTitleText":"Testing_NP_web", "navBarStyle":"transparent", "dataURL":"http://www.noshplanet.com/index.php", "showBrowserBarBack":"0", "showBrowserBarRefresh":"1", "showBrowserBarLaunchInNativeApp":"1", "showBrowserBarEmailDocument":"1", "forceRefresh":"1", "dataDetectorType":"0", "preventAllScrolling":"0", "hideVerticalScrollBar":"1", "hideHorizontalScrollBar":"1", "preventScrollBounce":"0", "preventUserInteraction":"0", "loginRequired":"0"} } Cheers! -- Smug
 
PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
like
10/13/13 10:49 PM (10 years ago)
Hi Smug, yes, I'm trying to launch a custom URL with that JSON, but really it's just to try and make a 'next' or 'more' or '>' button appear on the callout bubble itself, and to take the callout bubble a step further without having it connect to the default driving directions or similar. For some reason it's just not showing up for me. I haven't got lat&long hard coded in as it's pulling from a remote file. (And I've just tried it with a hard coding in a separate app I created to test it - still no extra button coming up on the callout bubble.) But my end game is this: I'm pulling data from a remote file via php. That data is appearing on my map as pins and as callout bubbles that appear when the user taps the pins. I'm still flummoxed trying to get the callout bubble to link to anything else ... ultimately I want it to link to other linked information that will be pulled from a linked table in my database. So I'm taking your advice and starting simple, but simple isn't as simple as I'd hoped! I'll give your JSON a go and see if I can make it work with the dataURL in there, thanks. Cheers Paddy.
 

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.