How to get the image from map in apple watch - ios

I am creating a map with custom image for annotation, I want an image from my map object.
Is it possible?

Assuming you are using WKInterfaceMap it is not possible to get the map image (at least not that I know of). You can create a map image locally in your map extension and then set that image on a WKInterfaceImage or WKInterfaceGroup. I am not sure what would be involved in creating a map image with MapKit. I create map images from tiles for use in my app and set it as the background on a WKInterfaceGroup to create a UI that looks like this Is it possible to position views on top of each other.

Related

Custom marker with server imagen in mapkit swift

Its posible set a custom marker with images loaded by server in mapview iOS swift? I jus found customs marker with local images
By marker, I'm assuming you are referring to and utilizing a MKAnnotationView (which is what Apple's pin views subclass from).
MKAnnotationView has an .image property, which you could set to any UIImage. You'd have to download the image first from server, then assign it to the annotation view.
It doesn't look like there is a way to link the MKAnnotationView's image property directly to a remote URL without defining that behavior for yourself (and perhaps subclassing drawing code).

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.

Add images over photo

I'm trying to develop an app where the user can take a pic and then overlay some sprites over the photo.
Something like these apps "Make me |something|"
Here is an example
But I really don't know what do I have to use (CoreGraphics, SpriteKit) to develop something like this. Any tips?
This can be easily done using UIViews
You can have a parent UIView
add a UIImageView in it . set it to custom photo image.
Now finally add a custom UILabel with text, another UIImageView or any other UIView to the parent view.
Then when you want to save just draw the parent UIView layer using core graphics(basically taking a screenshot) and save.

Resources