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.
Related
I'm using Mapbox SDK in my iOS app (using Swift).
I want a label to show under every marker like this:
I couldn't find anywhere in the docs or on stackoverflow how I can achieve that. I tried to make the text a part of the marker image, but the text does not resize itself that way and things are a mess when markers are close (or when you zoom out).
Does anybody know how I can make that happen?
Right now, you'll want to do this at the GL style level using Mapbox Studio — not as dynamic annotations.
Doing it in the style allows labels to be recalculated and customized based on the surrounding data and map state, whereas annotations currently aren't as customizable.
I am trying to implement something like Google's indoor maps feature, locally in my iOS app, using GroundOverlays. I could easily get the overlay part done by overlaying a .png image at some position in the map, using the API. I could also implement a custom floors switcher, just like Google's one, so it changes the floor overlay image. However, I still miss the ability to navigate in the native indoor maps. How can I define custom navigation paths in that region so when user navigates between two points inside it, the calculated path gets generated with respecting them?
Do any of you know a way in Xcode where I can save the coordinates of an annotation every time a person puts an annotation pin on the map.
Then after I save this annotation, when a person clicks a button. The map shows all of the annotations ever saved and shows their location on the map.
I think this is the most difficult problem in IOS because I don't see any tutorials or sample code. I don't think we know how to do this. Any geniuses??
Thanks
The way to do is,store annotation coordinates somewhere in the app.
You can store annotation coordinates in local xml/plist file or any another saving flat file saving mechanism and load them on fly. The other option is to use iOS CoreData (sqlite data store). Once you have them saved some where its all mater of reloading and using them..
I personally prefer coredata since it gives bit more flexibility than flat files..
In one of my iOS application I want to show an offline indoor map with navigation. I searched it in google and then I found solutions like routeme, mapbox etc .But the thing is I have to do this without any external libraries for that I did a sample project using mktileoverlay and it is working fine with that sample map. My problem is how I will make tiles for my indoor map with the proper structure and how to do navigation with that map. Thanks in advance.
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.