Whenever I move my map in my application I download new annotations(or coordinates rather) from a webserver, appropriate for the maps state.
I do not want to download already downloaded annotations again. I need a smart, selective way to download the new ones, avoiding duplicates.
You could grid off the map into sections and make requests based on tiles. that way you know if a tile has been downloaded or not and you can only request the tiles that are not yet populated.
Related
So, i am using native mapkit and load markers in json format.When i parse my json i have a special parameter, which detects what image should be used as icon(from images.xcassets) for current marker.But every time i load it, smth goes wrong and image assigns in unpredictable way and when i scroll map to new position and then back, markers again change their icons .Moreover, the same algorithm works fine on android using native sdk.I don't think the problem is in parse algorithm, but in map itself.Any suggestions?
Have a look at reuse identifiers for annotation views. It sounds like you are reusing views when you don't want to be, thus the new image is never set.
I'm using tilemil to create offline map for my iPhone app. I've added annotation to map through GEOJSON, and everything works great, but i have one question: how can i create and hook up annotations that is created in offline map with app annotations. Because annotations that is created in offline map showing as dots in my app.
Example:
what i have:
what i want:
should i just parse GeoJSON and add annotations with data this way, or there's some better approaches to do this? Thanks!
If you have implemented the points in TileMill, then their imagery will be "baked into" the map raster tile imagery. You can still have callouts for these if you also add interactivity to the map in TileMill so that tapping the points can retrieve data. A good example of doing this for regions instead of points is in the third tab of this sample project, as shown in the screenshot:
https://github.com/mapbox/mapbox-ios-example
Another option, as you've mentioned, is to just parse the GeoJSON client-side using NSJSONSerialization and then adding the points in Cocoa as RMAnnotation objects.
A third option is to add the markers in the mapbox.com editor interface and save them with your map, then you can retrieve them as simplestyle data automatically as in the Weekend Picks sample project that you've included a screenshot of. The GeoJSON can be automatically retrieved, parsed, and added as annotations in the project by the iOS SDK.
Im looking into having a tableview and a custom cell that has a webview control. The purpose of the webview would to show a google map inside the webview at some lat/long.
Could there be problematic with this approach? Memory issues?
Another approach would be having a uiimage and use the google map static api to generate the image and store the image on my server and have the app request the image via a URL.
I was hoping to avoid generating the images and storing them on my server and using directly the google map in a web view, but not sure what kind of issues i could run into with this approach?
The only problem is speed. If your table view consists of rows and rows of MKMapViews, it will take time for each one to load as the user scrolls through them. However, if there is only one it shouldn't be a problem.
The static image approach has the same problem but I think it might be slightly faster.
I have an app in the App Store for a local festival that had many events at different venues. Given that the audience was from all over the world, and thus unknown in town, the app showed a map for each event. I solved this using an MKMapView inside a custom UITableViewCell and using an accessory disclosure button that would push a detailed map view onto the navigation controller. It worked well, but was a little slow. I would not recommend it for many such cells.
Screen shot:
So yeah we're trying to display a pretty small version of the map and all the user interface elements were getting in the way.. and we realized a screenshot would probably be just fine, so just wondering if it's possible to generate a screenshot of a map position and just have it display as an image instead of an interactable map.
You can use Google Static Maps to show a non-interactive map without user interface controls (zooming buttons etc.)
As they return an image file it is easy to cache. Please note that Google does not allow caching of maps due to copyright reasons of the map owner, but probably caching is not necessary with the static map.
I'm playing with live tiles on Mango and it's all nice and all. User can delete secondary tiles and everything, but if the user "unpins" a secondary tile is there a way to know that tile is gone?
I want to persist data about an object when it's pinned. And I want to be able to delete that data when it's unpinned (from the start menu).
Is there something that's fired when a secondary tile tied to your app is unpinned?
There is no event that is fired when the secondary tile is unpinned. However, you can check for your application's active live tiles by querying the ShellTile.ActiveTiles collection. Not knowing your scenario you could run this check during the various application lifecycle events.
There is a decent screen cast on how to update tiles and use secondary tiles over on http://msdev.com as well as a How-To on MSDN. Both of these show examples of using the ShellTile.ActiveTiles API.