Use custom map image in UIMapView - ipad

I wanna accomplish the following, i wanna display a static map image that i have on UIMapView to use the benefits of the zooming and annotation, i've search very hard and i came up with these solution.
There is a library called route-me that give you the ability to customize the map, change the color of the map, specify a predefined road and building, highlight them, but it didn't help me in my issue.
I've looked on apple example that using the MKOverLay class, HazardMap, KMLViewer but they are not showing how to use an image to replace it with the map.
All i want is to display a map image that i have for a place and use it in UIMapView. can anyone put me in the right direction.
Thx in advance.

I replied to this question in this other post. Maybe it helps you:
How do I create an image overlay and add to MKMapView?

Related

How to keep an MKAnnotation View Image fixed on the center of the map as the user pans and moves the map around (Swift)?

using target 8.0 MapKit, I would like to define an MKAnnotation (such as a pin, or a custom one) that remains fixed on the center of the map view as the user moves the map around. Once the user stops moving the map, I would like to be able to read the new coordinates of the annotation. How can I do this? This in swift, thank you soo much
You can follow this link to accomplish this task.They are doing something very similar to your requirement. Its quite descriptive. Link

Create Custom Maps Xcode?

I would like to Create a Custom Map !
There is a way to do it so as to add this map to Xcode ?
I have an example in this picture below:
http://a1.mzstatic.com/eu/r30/Purple2/v4/92/d6/a8/92d6a818-1966-3a87-da0e-1aa6251d7e6a/screen568x568.jpeg
Thanks
Many way to do it.
Easy one is add UIImageView to UIScrollView and enable zoom on scrollview.
this way you can have basic map not good in memory.
Or, you can use some opensource like Mapbox, you can custom tile image map.
https://www.mapbox.com/

MapKit Ios Adding photo to annotation

I'm writing application for ios and I have a problem. I would like to add a photo to my annotation on MapKit.After adding annotation on AnnotationView, user has a button that invocates UIImagePicker.From this moment I have two problems.
1) How to update image after adding an annotation ?
2) How to add image to annotation? I can add small icon using leftCalloutAccessoryView but I would like something bigger. Is there a way to put a bigger image to AnnotationView? Or maybe someone knows how to make this small image resize on click?
Thanks for answering.

MapKit overlays to add floor plans to map

I am trying to add an overlay to iOS MapKit in order to show floor plans. However, I am unsure about the best way of doing this. If I add the floor plans by using an MKOverlay, will the floor plans be loaded lazily or do I need to find out which part of the map is being displayed and update overlays thereafter? I also looked at using MKTileOverlay, as it is using lazy loading, but I have the impression that it should be used for completely covering of the map and not only to add to the existing one. Is this correct?
Yes, you are right MKTileOverlay can cover whole map with tiles and Yes it is using lazy loading.
Use MKOverlay if you are not willing to replace native look and fill of map. You can also achieve lazy loading for MKOverlay too.
Note: MKTileOverlay will not remove your already existing MKAnnotations and MKOverlay.
MKOverlay is a protocol, not a class. You want MKTileOverlay as of iOS 7. Things are lazy loaded according to what portion of the map is currently shown.
You might find this useful as a reference on how the tiles are numbered and organized:
https://www.mapbox.com/foundations/how-web-maps-work/
As for covering Apple's map, this will happen by default, but you can also adjust the MKOverlayLevel used to place it between Apple's base map and labels layer, or you can use canReplaceMapContent = YES if you want to disable Apple's maps entirely.

How to add Annotation pin for source and destination in iOS using two color?

I am developing a small project, which will display the source and distance trace route, I did complete till that, now the thing is I am unable to add two annotation pin of different color for source and destination, suppose I am using red for source and green for destination.
This might be huge help for everybody who are learning and working.
Thanks
You could use images for your pins or you could use a subclass of MKAnnotationView - MKPinAnnotationView and just change the pinColor property, it's documentation can be found here:
http://developer.apple.com/library/ios/#DOCUMENTATION/MapKit/Reference/MKPinAnnotationView_Class/Reference/Reference.html#//apple_ref/occ/cl/MKPinAnnotationView

Resources