With the new maps in iOS6, is it possible to change colors of layers (parks, water, building) - iphone

I understand it's not ideal to change mapkit colors but specifically for a location based game I'm creating I'd like to have to colors much less dramatic and more dark. Is there a built in way that I can accomplish this? Since the game won't be specific to a certain region custom overlays wouldn't really work. I know with the old google maps the only way to do so was to create a javascript version of the map and add it in a webview (not ideal for the game) but with this new apple maps is there a way to redraw the shapes of these elements (parks, water, building) with a different color.
I don't have a complete understanding how the previous or current mapkits work from the ground up so if I'm missing any information or am confusing I apologize.

No there is no way you can do that in the current iOS6 maps.
The MapKit Reference does not have any inbuilt functions to do that.
I would seriously ask you to reconsider changing colors of the current MapKit even if you could do it through some other hack. You might get rejected from the App Store.
You have 2 options
a. Instead use your own maps from other vendors if you want to change colors and so for different places.
b. Overlays are a good way to go too but they are heavy work on REST side of downloading maps. I am currently using this in my map right now because all my map tiles are generated on the fly and I do not have to do too intensive work on the iPhone.

Related

Amount of requests on mapbox tile using flutter_map

I have recently implemented the flutter plugin called flutter_map, using the Mapbox tiles, and would like to know how you guys manage to count the network requests for the Static Tiles. Is it supposed to make a request for every move (zoom in, zoom out, move around, etc.) on the map itself? Is that the intended functioning or is there a way to diminish the number of requests made?Amount of requests made after zooming/panning
Is it supposed to make a request for every move (zoom in, zoom out, move around, etc.) on the map itself?
Yes indeed. The package supports static raster tiles, which means they must be re-downloaded if they change - such as on move or zoom events.
There isn't much in the way you can do about this, as it's a kind-of standard. This is why you'll find a similar thing in other mapping libraries, such as Leaflet.js and others.
See https://docs.mapbox.com/api/maps/static-tiles/ for potential ways to reduce costs whilst maintaining standards.

How to achieve density/heat map effect in iOS (iPhone/iPad)?

http://www.econguru.com/heat-map-of-worldwide-gdp-ppp-per-capita-2008/
This is CIA world Factbook map, each country has different color depth based on their GDP number. High GDP country has deeper color.
Right now, I am considering to develop such effect into my iPhone/iPad map app. I may want to use the apple map (probably not google map since iOS 6 has its own map), but I am not sure how to get such effect based on the country the user visited.
For example, the user visited US the most, then the map shows deeper color in US.
I haven't seen such effect in iPhone app yet. Any suggestion would be appreciated!
This should be doable using MapKit and overlays. You would need to construct an overlay for each area of the heat map and then set the color according to the data. I suspect the hardest part is going to be getting the geographic data you need to construct the paths for each region. AFAICT, there's no -pathForState: or -pathForCountry: type of functions in MapKit, so you're going to need to find another source for that information. But in terms of drawing overlays, it's all there in MapKit. Check out this sample code.
EDIT:
This question has some pointers on where to get that data.
You can get the coordinates ready to go in json format from the D3 project on github:
https://github.com/latentflip/d3/blob/master/data/world-countries.json
You can download this json, use NSJsonSerialization with the file to load the json into a Dictionary or an array, and then build your overlays from there.
One other thing: you aren't technically after a heat map; what you're afer is more of a "thematic" map.
Try the LFHeatMap class. Seems to be what you're looking for.
https://github.com/gpolak/LFHeatMap

Display Black&White MapKit

I'm working on an app with a MapKit map, which I want to display as Black&White, rather than the default color scheme.
How do I do that?
Is there a method I can set the color scheme with?
Are there specific constants I can set for the color scheme?
Is there a combination of masking the MapKit view with some image that applies an effect of Black&White?
Thanks,
Nur
You can use route-me instead of UIMapView and select the desired mapsource that suits you.
There's no way to change the colour of the map in MKMapView. The only thing you can change really is the mapType property which defines if it's a standard map, satellite or hybrid.
I doubt you'd be able to easily do anything with an overlay to make it B&W either. It might even be a violation of the terms of using the Google maps to do that anyway - I'm not sure on that, but it's possible it is.
So if you really need it B&W then I suggest using something other than the standard MKMapView.
To expand on some of the answers:
You cannot set MapKit to black and white. It violates the terms of use.
Your best bet is you use route-me with an offline tileSource. Google TileMill. They allow you to create your own maps from shape files which you can download off different sites. You then use route-me to display the maps you created.

Use an Image as an MKOverlayView (iPhone MKMapKit)

We want to use MapKit / MKOverlayView to create a map that looks totally customized. We would create a PNG that has the local streets / points of interest, and match that up to MapKit map.
I am finding some info that seems to infer that this is possible, but all the tutorials and examples I find are dealing with drawing lines and polygons, which is not what we want.
I have also considered the possibility of creating the PNG, grabbing the user's location and mathematically calculating their position on the image... but that seems like a bigger task than potentially using a MKOverlayView
Any ideas about how to get started would be much appreciated.
You could start by looking at Open Maps I believe you can customise their maps by creating your own XML file (different styles of roads etc..) You can then download the map tiles as PNGs or lazy load them in your app.
Google maps on the other hand you are not allowed to modify or store in you application.
However if you choose the open maps approach you have to effectively roll your own MapKit. This is tricky but very much possible. Start by looking at the apple developer videos on tiled scroll views.

Using custom map with MKMapKit

I am creating an iPhone app for OS4.0, and I am attempting to integrate a custom map with a standard MKMapView. I have been provided a map in .eps format (vector image), and I want to somehow overlay this on an MKMapView in and restrict the scrolling boundaries of the map so users cannot scroll outside the boundaries of the custom map. What's the best way to go about this?
I have read some stuff about hosting map tiles on a server, but this seems overly complex for my application. This would just be a map for an attraction roughly the size of a public zoo, so I would think that it would be conceivable to just convert the .eps to a .png file, and overlay it, but this might not give the best performance.
I understand that I could conceivable use a UIScrollView to do the job, but the problem is that I have dynamically generated MKPinAnnotationViews placed on the map, whose position must be based on latitude and longitude, so I can't think on an elegant or reasonable way to do it with a scrollview. Any ideas?
Thanks!
-Matt
Apple has a great bit of example code that will show you what you need to do. Check out the TileMap sample - it is available as part of the (free) WWDC 2010 samples download.
It shows you how to use the gdal2tiles utility to convert an input map into a tree of overlay tiles.
Another good bit of Apple sample code to check out is HazardMap, which is part of the regular SDK samples.