Show particular area shaded in MapBox - ios

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.

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.

Can iOS MapBox use rectangle offline map in .mbtiles?

I'm trying to make an offline map using iOS MapBox SDK. It's easy to make square map (eg. 32x32 tiles) but for some reason it doesn't work when I try to make rectangle map (eg. 40x32 tiles). It loads but it shows only a small portion of the map or skips some tiles. It just doesn't look as it should.
My .mbtiles looks correct, I checked .mbtiles and specification and it doesn't mention that there might be any problem with non-square maps.
Although, .mbtiles that comes with MapBox offline example called control-room-0.2.0.mbtiles is also square so maybe it's not possible for some reason.
Does anyone have experience with something similar?
A non-square region should work just fine -- there is no limit on this. One way to test your .mbtiles is to upload it to your MapBox account and see if it works on a web map. It sounds like your MBTiles file might have issues.

MKMapView clustering if too many Map Pins nearby

I'm wondering if any of you knows a method (library, category, etc.) to cluster iOS MapAnnotations if there are many of them at the same location (e.g. 4 pieces in about 10m).
It doesn't matter to zoom in because they are still overlapping. I've already tried https://github.com/applidium/ADClusterMapView (and sombe other libs) but all of them are made for showing clusters in zoom-out-scenarios. None of them really respect the distance between annotations when zoomed in.
I'm working on an app with an offline-db so a server-side solution is not an option.
thank you for your help!
You don't need 3rd party framework's anymore. iOS 11 has native clustering support.
You need to implement mapView:clusterAnnotationForMemberAnnotations: method.
Get more details in the Apple example: https://developer.apple.com/sample-code/wwdc/2017/MapKit-Sample.zip
You should have a look into CCHMapClusterController project, looks exactly like something you are looking for.
One alternative is the MapBox iOS SDK, which is an open source (BSD) library replicating MapKit behavior. It does both annotation clustering and offline map layers.
http://mapbox.com/mobile

How to dynamically draw maps

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.

Resources