How to dynamically draw maps - ios

In an iOS application, I want to draw a United States map with states and counties outlined. I also want to draw individual states with counties outlined. I have researched using Shapefiles to do the drawing, but I can't find a good API that translates shapefiles. I have looked into ArcGIS, but it seems most of the drawing they do is web/server based, also without the ability to draw individual states, or outline counties.
Does anyone know of a good iOS API I can use to draw the following maps?
United States with states and counties outlined
Individual state with counties outlined

Take a look at MapBox, it will let you draw these types of maps, then you can pull them in as tiles and overlay them with MapKit.
They also have an iOS SDK, http://mapbox.com/mapbox-ios-sdk/ if you don't want to use MapKit.

I think ArcGIS for iOS is your answer here. The iOS API will allow you to add a MapView to your application.
You can add one or more geoservices to that MapView, as well as local graphic layers.
MapServices are rendered server-side. FeatureServices are rendered client-side. You can also take features (each county or state would be a feature) from the FeatureService and put them into the graphic layer to implement different effects such as selection, outlining...
If you want to have all data stored in the client (the device), then you can embed the json representation of the features and add them to the graphics layer in the MapView, without needing to connect to any geoservice (although geo applications work better when connecting to a server)
Start here: http://developers.arcgis.com/en/ios/sample-code/
This sample looks similar to what you are looking for: http://www.arcgis.com/home/item.html?id=417a0bf9dfda482c8110ebdbde3edd66
This also looks promising: http://developers.arcgis.com/en/ios/guide/cloud-storage-feature-services.htm

All good answers above. The solution that ended up working for me was to simply use an SVG image, drag it into PaintCode and PaintCode gives me all the code to draw the image. A very simple and elegant solution.

Related

Use PNG as custom map iOS

I need to use a PNG as custom map of an indoor place. I don't need navigation but some places should be clickable like what we have in built in map. In android this is possible with MapView but I didn't find anything for iOS to do that. Can someone help me out how to start and do this?
A while back Apple added the ability to provide custom map overlay tiles. It isn't as simple as providing a PNG. You will need to create a database of map tiles at different scales, following a specific naming convention, and then provide a tiled map overlay.
I suggest looking at this blog post:
Custom and Offline Maps Using Overlay Tiles from VIGGIOSOFT
It goes into quite a bit of detail on what's required.

How to show ios map without labels?

Is there any way to show only the pure map in ios? Without any text, label or annotation.
Sample iOS Map
For ex, in that picture there is a lot of texts, labels..
Somehow... From iOS7 you can provide your own tiles, but you lose map kit original tiles.
Mattt has written an interesting post on NSHipster, you should check it
Another option is to try the Mapbox tools to allow full map customization.

Show particular area shaded in MapBox

I am using the MapBox iOS SDK for my project. Now I want to show shaded area in the Map for a particular area like any country, any continents etc. So how can I implement this feature.
Your suggestions and response will be helpful.
You can either do this client-side with something like RMShape or server-side by either shading things on the Mapbox.com online editor or making a custom map to upload with TileMill. The Mapbox site has lots of documentation on doing these things.

Subclassing MKMapView to provide custom maps?

I'd like to provide custom navigation maps in my iOS 6 application. I've tried adding overlay views that shows these custom maps in MKMapView and it didn't work well because it needs a higher zoom level than what Apple's component can provide (the desired zoom level is about 10 screen points per meter in the map).
The question is, is subclassing MKMapView a good way to approach to this? The primary reason is I'd like to take advantage of MKMapView's coordinate conversion functions:
convertCoordinate:toPointToView:
convertPoint:toCoordinateFromView:
convertRegion:toRectToView:
convertRect:toRegionFromView:
Those functions makes it easy to convert screen points to world coordinates (latitude/longitude) and vice-versa.
Thanks in advance!
I don't think you are going to have much luck with subclassing MKMapView. There is a lot going on behind the scenes related to tile loading that you cannot access.
I would guess you would be better served using something along the lines of the MapBox iOS SDK or another similar map engine.
It allows you to specify your own tile sources and has plenty of examples to show you how it is done. It also had functions, like map kit, to handle converting values to and from lat/lon.

Animated 2d Map Desktop Widget

I need to animate some vector icons smoothly moving about a 2d map. I have time-lat/lng pairs forming tracks. Down the road I would really like to be able to convey various GIS data like topography and roads on the map along with my smoothly animated icons.
Any suggestions on what to use? I find things like Quantum GIS but it seems geared to generating static maps. I've tried messing around with KML but I cannot find any way to make things move smoothly: marker icons clearly bounce along the waypoints even when I space them very closely.
EDIT: clarified I'm interested in a desktop widget
Animation options are limited in GIS as far as I am aware.
ESRI's ArcObjects could be used to create animations - see this chapter in the online help:
http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_animation
and these examples (however none have vectors moving around):
http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Sample_animation_videos
ESRI software is expensive to purchase, and users would also need the software if you wanted to provide more than an exported video.
You are probably best working with WPF (is this widget for Windows?), Silverlight, or Flash. ESRI have a Silverlight example here:
http://www.codeproject.com/KB/showcase/GIS_Silverlight.aspx
There is also the following collection of WPF classes for the OpenSource SharpMap:
http://wpfsharpmapcontrols.codeplex.com/
However it seems very much in beta at this stage.
Alternatively it may be easier to use GIS software solely to provide a background image, and do all the animation elsewhere.
I would say, try this animation code for Google Earth; however, try emailing the osgeo or qgis userlists and they'll guide you

Resources