mkmapsnapshotter

Create a clickable map preview using MKMapSnapshotter

我与影子孤独终老i 提交于 2021-01-29 04:56:06
问题 I have a map that currently shows the user's current location with no pin to show them exactly where they are. I want to make the map a photo of where the user's set location is. I only know how to show where their device is and need them to be able to set their base of operations. I don't need specific addresses. I just need the city where they reside. I then need the image to be able to be tapped on. When tapped, the image makes the MapKit full screen and interactive. They can then zoom

Create a clickable map preview using MKMapSnapshotter

二次信任 提交于 2021-01-29 04:52:02
问题 I have a map that currently shows the user's current location with no pin to show them exactly where they are. I want to make the map a photo of where the user's set location is. I only know how to show where their device is and need them to be able to set their base of operations. I don't need specific addresses. I just need the city where they reside. I then need the image to be able to be tapped on. When tapped, the image makes the MapKit full screen and interactive. They can then zoom

MKMapSnapshotOptions : Adding snapshot of Custom Pin Annotation View or UIView

走远了吗. 提交于 2019-12-21 02:20:52
问题 I am trying to get snapshot of map view with startWithCompletionHandler methods of MKMapSnapshotter. and I want to add Custom Pin Annotation View to snap shot. and there is a label in my custom annotation view. so I can not show that label when ı am getting snapshot. here is the code: let snapshotter = MKMapSnapshotter(options: options) snapshotter.startWithCompletionHandler() { snapshot, error in if error != nil { completion(image: nil, error: error) return } let image = snapshot.image let

Swift 3 Add custom annotation pin to MKMapSnapShotter snapshot

不打扰是莪最后的温柔 提交于 2019-12-18 16:46:05
问题 I'm learning Swift 3 on my own, and my current learning project involves allowing the user to snap a photo and get a map snapshot with the current location pinned. I've relied on this answer from Aug 2015 and this answer from Jun 2016 for guidance, but I still can't find the right path. Right now, I can... Get the photo from the buffer Get a map snapshot But I just can't place the pin. I know that my code is incomplete and ineffective -- so this is more than just a debugging question. Here is

iOS MKMapShapshotter completion block is not always being called

一个人想着一个人 提交于 2019-12-18 07:46:19
问题 I am trying to use the new iOS7 MKMapSnapshotter to generate a static map image. Whenever my app needs a map, I call the following: MKMapSnapshotter *snapshotter = [[[MKMapSnapshotter alloc] initWithOptions:theOptions] autorelease]; dispatch_queue_t aQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0); DebugLog(@"Snapshotter allocated %@ and run on queue %@", snapshotter, aQueue); [snapshotter startWithQueue:aQueue completionHandler:^(MKMapSnapshot *snapshot, NSError

Keep MKMapSnapshotter as NSData in memory - Swift

限于喜欢 提交于 2019-12-12 14:52:43
问题 I'm trying to take a screenshot of my MKMapView. I usually achieved this using the below code in Objective C. I'm wondering how I would keep the NSData object in memory, rather than saving the image, and then reading from it straight away. I'm also wondering how this could be written in Swift - In particular, the completion handler part. I've looked at the docs - but unsure of syntax:https://developer.apple.com/library/prerelease/iOS/documentation/MapKit/Reference/MKMapSnapshotter_class/index

MKMapSnapshotter completionHandler never called in parent app when called from WatchKit

隐身守侯 提交于 2019-12-12 03:36:27
问题 I have this weird issue: I call the parent app with openParentApplication:reply: as normal. It is nicely doing its job getting some data from the internet using async NSURLRequests but when I want to get a map image using MKMapSnapshotter (still in the parent app) its completion block is never called. MKMapSnapshotter *snapshotter = [[MKMapSnapshotter alloc] initWithOptions:options]; [snapshotter startWithCompletionHandler:^(MKMapSnapshot *snapshot, NSError *error) { NSLog(@"completion

MKMapSnapshotter uses incredible amounts of CPU & RAM

笑着哭i 提交于 2019-12-09 15:12:15
问题 MKMapSnapshotter seems to use up to 2GB of RAM when in the simulator, and triggers memory warnings and hangs my app for a very long time on the device. I'm not sure what part of my settings is causing this. This huge usage occurs when retrieving multiple image simultaneously, but even retrieving multiple images one after the other seems to use frankly huge amounts of RAM, 600MB at peak, and fully occupies the CPU, using up to 190%. I've tried removing all other logic, not even saving the

VectorKit crash reports with MKMapSnapshotter on iOS

ぃ、小莉子 提交于 2019-12-04 08:46:54
问题 I'm getting different kind of crash reports related to VectorKit and MKMapSnapShotter . Crashes occur pretty random, but it seems like they happen most when returning from the background. The device does not send out any memory warnings before it happens. What's happening here? I'm using: if (!_snapshotQueue) { _snapshotQueue = dispatch_queue_create("com.bestappever.snapshot", DISPATCH_QUEUE_SERIAL); } [_snapshotter cancel] _snapshotter = [[MKMapSnapshotter alloc] initWithOptions:options]; _

MKMapSnapshotter uses incredible amounts of CPU & RAM

一笑奈何 提交于 2019-12-04 02:57:50
MKMapSnapshotter seems to use up to 2GB of RAM when in the simulator, and triggers memory warnings and hangs my app for a very long time on the device. I'm not sure what part of my settings is causing this. This huge usage occurs when retrieving multiple image simultaneously, but even retrieving multiple images one after the other seems to use frankly huge amounts of RAM, 600MB at peak, and fully occupies the CPU, using up to 190%. I've tried removing all other logic, not even saving the images after they're requested, and the huge RAM & CPU usage still occurs. This cannot be intended. There