views:

1508

answers:

8

Hello,

I'm with building a map application for iPhone, and I wanted to ask what the best way is for bringing maps from a website onto the iPhone.

I want to fetch small images of size 80x80 and show them. This kind of activity might be achieved by using UIKit or OpenGL ES.

Also if you can bring to my notice some kind of achievement and guides for this thing, I would be really very thankful.

+1  A: 

Take a look at this topic: http://discussions.apple.com/message.jspa?messageID=8157498. It's nearly the same as what you're asking for.

Ben Alpert
A: 

Would you be able to use iPhone SDK 3's MapKit API, or do you need to use custom maps?

Alex Reynolds
+1  A: 

For small static maps, you could use Google's static map API

You can construct a URL to get your image like this:

NSString* urlString = [NSString stringWithFormat:@"http://maps.google.com/staticmap?center=%f,%f&zoom=%d&size=%1.0fx%1.0f&key=%s&sensor=true",
            aLocation.coordinate.latitude, aLocation.coordinate.longitude, // aLocation is set to the center of the map
              kCardBackGoogleMapsZoomLevelDefault, 
              80, 80, // your map size
              kAIGoogleMapAPIKey]; // your google maps API key

All the other maps suppliers support static tiles - Microsoft, Yahoo and CloudMade.

Roger Nolan
A: 

If you have a set of custom tiles you want to load, you may want to look at mapping engines put together by companies like MapNinja that let you use your own tilesets.

Otherwise it's a lot of coding to do something like a tiled map engine yourself.

Kendall Helmstetter Gelner
A: 

I need to get the custom maps for some other vendor..

Besides that i know how to get the images its the rendering part and displaying part that what my problem man.

y ramesh rao
This is an update to the question, not an anwser itself, so you should update the original question.
Mike Abdullah
A: 

If you're looking to just embed a single, non scrollable map, then have a look at the Google Static Maps API, which will generate map images for you on the fly, depending on your request parameters.

If you want to implement a slippy map, then either try route-me, which works with OS 2.2.1, and supports custom tile servers. Or have a look at MapKit/Google Maps in OS 3.0.

tomtaylor
+1  A: 

As far as displaying the scrolling map is concerned, CATiledLayer would be the way to go. It's a slightly complex class to use, but you can find some examples if you google it.

U62
A: 

You could also use the Route-Me project

http://code.google.com/p/route-me/

BSD Licensed - perfect if you need to render your own tiles

FeralBob