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.
Related
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.
Here is the scenario...
I have a image of a map in jpeg format... I want to add it to my iPhone application and mark the coordinates in certain places (just like annotation in map kit ) and also when i move from one place to another place the current location should change and the new location should be marked in the image.
Is that possible ? How to achieve this instead of using the mkmapview ?
I found this tutorial how to add custom google maps, maybe you could use your image (.jpeg) as a overlay.
stiern.com/tutorials/adding-custom-google-maps-to-your-website
Sounds like you want to use an MKOverlay.
Essentially it boils down to looking at the TileMap sample code from WWDC 2010. It'll still load the Google Map in the background and your map over the top
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.
I want to know how to display the route between two Points on
map using mapkit framework in iphone
Is there any Api that can used to display the route between two
Pins. If not Is Polyines is standard to show route between two
pins.Can we display the route on Map with the help of polyines on iphone
or is it dummy route between two points.
Thanks in advance
There's a nice sample on how to accomplish this with a custom MKAnnotationView here: http://spitzkoff.com/craig/?p=108
You can find a working example at http://github.com/leviathan/nvpolyline This solution is especially targeted at iPhone OS versions prior to v.4.0
Although it can also be used in v.4.0 Hope this helps.
You could use Quartz to draw your lines.
Get the context of your map view
Move to the point of your first pin
Add a point to the point of your second pin
Configure your stroke (line-style, width, color)
Draw
A good tutorial about drawing with Quartz:
http://www.cocoadevcentral.com/d/intro_to_quartz_two/
If you do this you will have your app rejected. You are not allowed to use the Google Map tiles (and thus MapKit) for routing.
You can use one of the open map frameworks, they may also support API's for drawing routes atop them. I would explore that before figuring out how to draw your own polylines.
Need to use own imaged markers instead built-in pins. I have several questions.
1. Is it legally? I have a doubt because there is no standard support for markers(pins) with own icon.
How to make a marker with own icon right way?
I found the post which actually describe how-to: http://www.arlingtondev.com/thoughts/?p=81. I am a newbie, but it looks like a "crutch", which i do not want to use in my clean code. Could you advise better way? I had a lot of problems while integrate that method and currenlty cannot move and animate icons, that's why decided to ask stackoverflowers.
Yes, you can. Check the MKAnnotationView class, it's specifically designed for that. In fact, MKPinAnnotationView inherits from it. Use the image field to specify an image.