views:

46

answers:

2

Hi all,

I know many people have had the similar issues and some have sorted them and others not. Basically I need some way to refresh the map ie get a callback to mapViewDidFinishLoading. If the location displayed has already been seen by the user it seemd the map is loaded from the cache and doesnt call mapViewDidFinishLoading which I need it to do because this fires some of my game code. Does anyone know how to do this on ios 3.1.2 and upwards? [Something along the lines of [mapView reload] (if only it were so simple).

Many thanks

Jules

A: 

Hi,

I suppose the map's loading is triggered by the user dragging the map so you could use the mapView:regionDidChangeAnimated: callback and include your game code in it.

Charter
Thanks for the help, unfortunately this is where the problem lies. The maps loading is triggered by a button connected to an IBAction which gives the map a region to display. The reason I need to use the mapDidFinishLoading callback is because I have a timer which can only start when the map is fully loaded. Any other ideas?Many thanksJules
Jules
Then you could use the mapViewWillStartLoadingMap: callback. If mapViewDidFinishLoading is not called I suppose that one isn't called neither.Start your timer in mapView:regionDidChangeAnimated, re-init it in mapViewWillStartLoadingMap: and start it again in mapViewDidFinishLoading: Is it a good workaround ?
Charter
Hi, this wont work either as none of the maps delegate functions are getting a call back. This only happens when the needed location has already been loaded at some point so what I really need to do is either reload the map somehow or flush the cache somehow??Many thanks againJules
Jules
A: 

Don't know if you still need this, but I had a similar problem with viewForOverlay not being called. Actually it eventually got called, but too late for what I needed.

using the following it updated when I needed it to -

[self.map setVisibleMapRect:myMapRect];
clarky
Hi, I did try this but it didnt help in my case. In the end I just changed the way my game logic worked, not ideal but it works now. Cheers
Jules
glad you got it to work.
clarky