Discussion Forums  >  Maps, Device Location, Tracking

Replies: 0    Views: 259

PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
05/04/14 05:36 PM (9 years ago)

'refresh map data' vs 'reload plugin' - some wisdom needed please

Hi all, I'm trying to get my head around 'what happens' when bt_screen_map is refreshed using the circular arrow button on the map toolbar. I want to understand this so I can emulate that behaviour with another button, but I want to use this new button to 'refresh' the map with a brand new set of datapoints via a SECOND dataURL, not the ones that the plugin originally loaded with (ie it loads first time with the dataURL that I set in the control panel - and I still want it to do this on load). I have two questions: 1. My gut tells me that it makes more sense to load a new set of data onto the existing map than to re-load the whole map view - is that correct? if yes, then... 2. How do I set a new and different data call into the refresh method/cascade? To me, the cascade looks like this (all this is in bt_screen_map): The refresh button is made active using //show refresh button? SEL sel4 = NSSelectorFromString(@"refreshData"); <....more code....> and that selector 'calls'(?) the refreshData method which calls the downloadData method, like this: //refresh is a help for download -(void)refreshData{ [self downloadData]; } //download data -(void)downloadData{ [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"downloading screen data from: %@", [self saveAsFileName]]]; //flag this as the current screen noshplanet_appDelegate *appDelegate = (noshplanet_appDelegate *)[[UIApplication sharedApplication] delegate]; appDelegate.rootApp.currentScreenData = self.screenData; //show progress [self showProgress]; NSString *tmpURL = @""; if([[BT_strings getJsonPropertyValue:self.screenData.jsonVars nameOfProperty:@"dataURL" defaultValue:@""] length] > 3){ //merge url variables tmpURL = [BT_strings getJsonPropertyValue:self.screenData.jsonVars nameOfProperty:@"dataURL" defaultValue:@""]; It looks as though the downloadData method is using the dataURL specified in the config file as its original source, which makes sense. But when I change nameOfProperty:@"dataURL" defaultValue:@"" to nameOfProperty:@"dataURL" defaultValue:@"www.mydatasource/newdataquery.php" it isn't returning anything different. If anyone has had any experience playing with this I'd be most grateful for your insights. 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.