Custom Map View - 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

Related

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.

Fit Images in MKMapview

I am using MKMapView , i want in my map the background image will display instead of map
i have some local images and i want that images will be shown instead of original map on
MKMapView
any help please?
You should be using CATiledLayer and a UIScrollView if you want to roll your own solution and need something pretty simple, or use https://github.com/route-me/route-me a native open source map library that enables you to use custom map tiles.

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.

iPhone - Add annotation to My own Map

I have an image plan of stores of exhibitors hall. So I need to add annotation to each store in the plan, which is a jpg file.
iPhone MapKit looks like supports only world map. Are there any way I can add my own picture and add annotation to it like google map annotation.
Thanks
I don't think you can do that.
What you can do is using a UIScrollView to scroll and zoom in/out your jpg plan and use subviews to simulate annotations. That's what I would do.
MapKit does not support custom tiles, so your only option is to implement your own map using UIScrollView (and potentially CATiledLayer if the map is large / has many zoom levels).

polyines on iphone

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.