Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 7    Views: 71

PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
03/23/14 03:35 PM (10 years ago)

Has anyone added a search bar to BT_screen_map?

Hi all, My scenario: my app launches BT_screen_map which pulls its location items from a remote URL. By default it pulls items that are within xkm of my current location. Awesome. BUT.. I'm going to Vegas soon (I wish!!) and I want to see what's of interest there instead, just to see if it's worth the trip. So I need a search bar on the map screen that will send a query to the map's MySQL dbase and return a different set of location items for my 'Vegas' (or whatever) search term. Has anyone done something similar? I think I can muddle through the php, but I'd love some guidance on setting up a search bar as a customisation to the plugin. Cheers Paddy.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/23/14 03:42 PM (10 years ago)
I have a 'location menu' I keep threatening to finish… It doesn't display a map… it's like the list of locations you display 'before' you show the map. you'll be able to sort by name, distance, and category, and also supports search. Not *quite* what you're looking for, but I imagine it would fit in somewhere. Hope to have it completely complete before Vegas. Cheers! -- Smug
 
PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
like
03/23/14 03:47 PM (10 years ago)
Sounds close Smug. Looking forward to seeing what it does! :) Cheers Paddy
 
PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
like
03/23/14 06:49 PM (10 years ago)
Do you know which of the four h/m pairs is the view controller for the map screen? The plugin has BT_mapAnnotation, BT_mapAnnotationView, BT_mapZoomLevel and BT_screen_map in its directory. I thought I'd try and add a search bar to the screen by modifying the plugin with a xib file (so I can drag a search widget into it in Xcode). When I create that new xib file, I go to specify its new class and the only one of these that comes up as 'available' is BT_mapAnnotationView... ok, but then Xcode won't link to that file as the owner of the xib view. Any ideas? (Or maybe this is a separate question?) Cheers Paddy
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/23/14 07:42 PM (10 years ago)
Honestly, I haven't played with the map as much, so I can't be really sure. But if you add a search bar to it, it's going to need to have an array of values 'somewhere' to search through… that might be within the annotation, but again I'm not entirely sure… Can't be sure if this is related to your current task, or a future task, but I thought this was interesting… https://developer.apple.com/library/ios/samplecode/MapSearch/Introduction/Intro.html Cheers! -- Smug
 
PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
like
03/23/14 08:05 PM (10 years ago)
Thanks Smug, I reckon I will need to make use of that link soon, there's some good stuff in there. Some of it looks kind of familiar so it may give me the crumbs I need to find similar functions in the BT_screen_map plugin. Thanks! :) The values array will have to come from a MySQL request because I want the search to look through my remote database. So I'm thinking that the search bar will have to be coded to pass the search term(s) through to a php file that then executes the search. Basically it's acting as a webform, really. Shall keep noodling! Cheers Paddy.
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
03/23/14 09:58 PM (10 years ago)
I think you both have my Add-on's package. There is a search on the Control Panel, not in the app. But maybe there is something you could do in an html doc to search for values and modify the array of map points. I have never used it...it needs adjustment... but I also have a php file for uploading records from a CSV file.
 
PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
like
03/23/14 10:13 PM (10 years ago)
Thanks Susan, for what I'm hoping to do I think extracting the records will be relatively simple - it will just be changing the parameters that the php passes to the mySQL. It's getting a search bar to show on the map screen that is proving tricky!! I really need that search bar present on the map screen itself. How are you with xib logic? Do you know if there is a way to ensure that whatever I add to a xib file sits 'on top' of whatever might already be in the plugin's 'main' view controller? (if it was CSS I'd want to give it a z-index!!) Or do I need to move things around to accommodate items specified in the xib file? (eg move the map screen down so a xib-specified search-bar sits between the top of the map and the bottom of the nav bar). All ideas very welcome!! EDIT: Discovered that yes, I need to move other elements around to make room. First problem solved.
 

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.