Discussion Forums  >  Maps, Device Location, Tracking

Replies: 5    Views: 184

HKH
Aspiring developer
Profile
Posts: 2
Reg: May 10, 2013
West Covina
20
05/12/13 09:34 PM (11 years ago)

How to use Screen Data URL to show local Department of Vehicles in the Map plugin?

I'm new to buzztouch! Hello everyone. Love this platform and learning everyday. Can someone give me an example and how-to use the "Screen Data URL" to show local "Department of Vehicles" in the Map plugin? I don't know how to do the .php script to get that information in my Map plugin. Thanks for your help!
 
WebNevees
Code is Art
Profile
Posts: 206
Reg: Oct 28, 2012
KL
11,660
like
05/13/13 10:59 AM (11 years ago)
I think you will find a video which actually does a tutorial on this by David Book. He shows you how to output a json object using php which pulls in data from your database if that is what you're after. This is for when you have changing map locations or you want to add to them all the time. If not and you only have a set (even a long list) of points you want to show on the map that are not going to be updated much, then don't go down the php route at this point. You will need to have a web host if you do. In this case you can just create a json object in a text file, then copy and paste it to wherever you want and it doesn't even need to be php then. Just point to the URL in your map's dataURL section and you're good to go.
 
WebNevees
Code is Art
Profile
Posts: 206
Reg: Oct 28, 2012
KL
11,660
like
05/13/13 11:00 AM (11 years ago)
Oh, and hello and welcome! Enjoy the ride!
 
HKH
Aspiring developer
Profile
Posts: 2
Reg: May 10, 2013
West Covina
20
like
05/13/13 01:04 PM (11 years ago)
Thanks for the welcome! :) What i'm trying to do is simply click on the map plugin on home screen on iOS then the map app opens up, simply display the closest DMV locations near me What's the best method of achieving this?
 
WebNevees
Code is Art
Profile
Posts: 206
Reg: Oct 28, 2012
KL
11,660
like
05/13/13 10:48 PM (11 years ago)
Ok HKH, you'd have to create a location map screen in your buzztouch control panel, You will then notice a map locations section where you can add any number of locations to your map from here. The locations will get inscribed into your BT_config.txt file in your project and stay there until you make an app update with new locations, update or update them from the CP itself (an on the fly update). The locations show up in the BT_config.txt file as a "childItems" object inside the map screen object you created. Very straightforward up to here. Now this is definitely not what you want because this will show all locations to all users in the same way. What you would need is to create a special "childItems" object inside the map screen object FOR EACH USER. This would be referred to as a dynamic list which you would need to create yourself. The good news: you won't need to mess with objective-C or Java code to get this done. The other good news: luckily(!) the buzztouch Control panel has foreseen this capability and gives you the chance to enter a url for the app to hit and look for the list of locations it needs in at that URL. It can also send in it's own location details and some other parameters to help you build the list. Just put the address of your hosted php file in the "Screen Data URL" section. If it's blank, it will not load the items remotely. The other other good news is that you will need to fiddle only with some php code you might know already (or can find tons of tutorials on) to create the list. The overall requirements of the list is known (just take a look at a sample childitems section of a map screen you make yourself through the CP) and it has to be in JSON format. That's it. You can just output items in the list that are within a special distance from the user. Each time the user opens the map screen, the items will be loaded from the php url you specify in the "Screen Data URL" section of the map screens control panel page. An now the bad news: There is so much possibility now that you know these secrets you will have a hard time living your previous normal life! Have fun!
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
11/11/13 06:11 PM (10 years ago)
Great answer, @Webneeves! I found this on a Google search. If you send me this in a pdf I will add to the How-Tos. It is extremely helpful.
 

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.