Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 5    Views: 85

epicweb
Aspiring developer
Profile
Posts: 159
Reg: Aug 30, 2012
Glen Carbon
4,990
11/15/13 11:49 AM (12 years ago)

Map Locations loading webview

Has anyone used this example for load webview json data... http://www.buzztouch.com/applicationScreens/locations_demo.txt I can not get this to work in IOS7. I have not tested in IOS6.
 
epicweb
Aspiring developer
Profile
Posts: 159
Reg: Aug 30, 2012
Glen Carbon
4,990
like
11/15/13 11:50 AM (12 years ago)
example does not load: loadScreenObject: { itemId: "screen16" itemNickname: "name16" showBrowserBarLaunchInNativeApp: "1" itemType: "BT_screen_webView" dataURL: "http://domain.com/ltf/?location=location-2" }
 
epicweb
Aspiring developer
Profile
Posts: 159
Reg: Aug 30, 2012
Glen Carbon
4,990
like
11/15/13 01:10 PM (12 years ago)
using BT_screen_customURL instead of BT_screen_webView solved it.
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
11/15/13 01:14 PM (12 years ago)
Awesome! Great tip and example! LA
 
epicweb
Aspiring developer
Profile
Posts: 159
Reg: Aug 30, 2012
Glen Carbon
4,990
like
11/15/13 01:27 PM (12 years ago)
here is what I have done so far using wordpress and json api plugin (http://wordpress.org/plugins/json-api/) for wordpress. Basically create a new controller file called map in the json api controller folder and drop this code in your new php file. This code using a custom post type called location and 2 post custom fields for long and lat (will need to know some wordpress to get this going). helpful video.. http://vimeo.com/48773789. Once you have the json api controller setup in wordpress you can replace the data url on the location map screen. Cool stuff. code example... <?php /* Controller name: map Controller description: Data manipulation methods for posts */ class JSON_API_Map_Controller { public function get_locations() { $array = array(); $args = array('post_type'=>'location','posts_per_page'=>-1,'orderby'=>'title','order'=>'ASC'); $loop = new WP_Query($args); $counter = 0; while ( $loop->have_posts() ) : $loop->the_post(); $array['childItems'][$counter]['itemId'] = get_the_id(); $array['childItems'][$counter]['title'] = get_the_title(); $array['childItems'][$counter]['subTitle'] = get_the_title(); $array['childItems'][$counter]['latitude'] = get_field('latitude'); $array['childItems'][$counter]['longitude'] = get_field('longitude'); $array['childItems'][$counter]['itemType'] = "BT_mapLocation"; $myArray = array('itemId' => "screen".get_the_id(),'navBarTitleText'=> get_the_title(),'transitionType' => "fade",'itemNickname' => "name".get_the_id(),'showBrowserBarLaunchInNativeApp' => "0",'itemType' => "BT_screen_customURL",'dataURL' => get_permalink()); $array['childItems'][$counter]['loadScreenObject'] = $myArray; $counter++; endwhile; return $array; } } ?>
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
11/15/13 01:33 PM (12 years ago)
Thank you! LA
 

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.