I want to you iPhone LocationManager and display the position using a custom map, different from the one used by MapView. Is there any way to customize the MapView or should I rebuild my own MapView from scratch ?
Do you think MapView will be open to achieve this kind of customization in a future release of the SDK ?
Do you have any recommendation to rebuild a MapView from scratch. I will have to divided my map in level and each level in tiles. But should I associate a tile with an UIImage or should I build/manage dynamically an UIImage composed of tiles currently displayed ?
Please make sure you file a bug with Apple, asking for this feature (I already have). In the meantime, I think your best bet is to take a look at the route-me library. It emulates the built-in Google Maps application, but uses either OpenStreetMap, Microsoft VirtualEarth or CloudMade as a data source for tiles. You could add support for loading tiles from your own custom service.
Related
For my next project I have an image of a small village and I have to turn this into a map.
In this map I have to be able to add MKAnnotationView like the "normal" MapKit Map. The user can also zoom the map. I'm just trying to figure out how to implement this custom map: The only possible way is to create a UIImageView as subviews to which I add the "reproductions" of MKAnnotationView?
Any suggestions on how I can create this type of map?
Also have a look at MapBox. There are two options:
MapBox iOS SDK - works like MapKit, but is an open source alternative that lets you do completely custom maps (iOS 5+).
MBXMapKit - built on MapKit, but allows custom map tiles (iOS 7+).
I don't think using a UIImageView will work particularly well. If the suggested source code doesn't work for you, look at the documentation and sample code for CATiledLayer.
I want to get image of any location and use this image for showing a view. I will look like a MKMapView but it's faster (I think so)
For Google Map, there is api to do : https://developers.google.com/maps/documentation/staticmaps/
But what about map of iOS? Can you help me?
--UPDATE--
Solution: MKMapSnapshotter
Under iOS7 you can use MKMapSnapshotter to asynchronously generate MKMapSnapshot objects which you can ask for their UIImage representation.
Otherwise your best option is to use a MKMapView and to set userInteractionEnabled to NO.
Alternatively Google Maps provides a static maps API.
I already have a tile source set up for use with the Google Maps JavaScript API. I am trying to translate this for use with the iPhone MapKit. I have correctly implemented the javascript zooming levels into mapkit. Whenever - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated is called, I snap the region to the nearest zoom level based on the same center point.
Is it possible to implement a solution possibly with CATiledLayer to implement a tiling solution. Does the iPhone use the standard 256x256 tiles like google maps does natively? Any direction or help on this would be greatly appreciated. I would rather not waste a couple weeks trying to implement this if it's not possible.
FWIW, I spent quite a bit of time looking for a decent solution… before diving into a CATiledLayer example, I noticed MKOverlay and MKOverlayView — which are new in iOS 4 and plug right into a MKMapView.
Couldn’t find a good example implementation of using MKOverlays that pull arbitrary image data (say, UIImages from a remote tile server), but I tinkered around with the API enough until I got it working.
Built a simple example implementation of it in case anyone (like me) wants a reference:
http://github.com/mtigas/iOS-MapLayerDemo
Hope this helps someone out in the future.
MapKit doesn't provide much in the way of custom tile sources (in fact, it provides absolutely nothing to customize sources: you either use Google Maps or you don't). I've been working with a similar problem myself, though, and I've found RouteMe to be a pretty good solution for custom maps: http://code.google.com/p/route-me/
Built-in support exists for OpenStreetMaps, OpenAerialMaps (which is currently offline), Virtual Earth, and Yahoo Maps, but the framework makes it pretty easy to plug in your own tile source, too.
Yes, since iOS 7, MKTileOverlay will do:
https://developer.apple.com/library/ios/documentation/MapKit/Reference/MKTileOverlay_class/Reference/Reference.html
In our iPhone app we need to draw a route on Google Maps (GMaps is the only option, we can't consider other maps).
We draw the route while the user walks around - GPS tracking basically. Then we display all saved routes on the map. The problem is that Google Maps is almost unusable. It is impossible to scroll the map, zoom it (everything is extremely slow).
Now we draw the route on a transparent layer [UIColor clearColor] in the method
- (void)drawRect:(CGRect)rect
which is called using [ setNeedsDisplay] through UIGraphicsGetCurrentContext.
Our task is to draw a route (almost like in native iPhone GMaps app) so that the map will be scrollable and easy to zoom and the route won't be glitchy.
As an example of what we need to do I can point to this app http://itunes.apple.com/us/app/endomondo-tracker/id333210180?mt=8
Maybe you can point me to any of the libraries that do this?
Thank you for your help.
You might want to have a look at http://github.com/mobilemelting/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.
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.
EDIT:
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.
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.
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.
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.
Would you be able to use iPhone SDK 3's MapKit API, or do you need to use custom maps?
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.
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.
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