简体   繁体   中英

HERE Maps - Map Snapshot is a black rect (Premium SDK)

NMAMapView.snapshot(geoCoordinates: coordinates, zoomLevel: zoomLevel, orientation: orientation, size: size) { result in
// Result here is a black rect UIImage
}

By using this code I'm getting black this rect: 在此处输入图像描述

What wrong? (It worked before, not changes where made in client side). HERE Maps SDK (3.20.2) via CocoaPods.

Creates a temporary map view with a specified size and position and then renders it to a UIImage - nothing is rendered to the screen.

This class method is used to create a static image of a map. The snapshot will have the same visual appearance as an equivalent NMAMapView with the same geocenter, zoom, orientation and frame size.

Only one snapshot will be processed at a time, but any number may be queued up via successive calls to this method. Snapshots will be processed in the order they are received.

Unlike snapshotWithBlock:, this method will never take a snapshot whilst the app is backgrounded. If the app is in the background then the snapshot will be deferred until the application enters the foreground again.

If not already downloaded, this method will download the required map data for the region specified, so a snapshot will take longer to complete for a region where no map data has been downloaded. Declaration Objective C:

+ (void)snapshotWithGeoCoordinates:(nonnull NMAGeoCoordinates *)coordinates
                     zoomLevel:(float)zoom
                   orientation:(float)orientation
                          size:(CGSize)size
                         block:(void (^_Nonnull)(UIImage *_Nonnull))
                                   resultBlock;

SWIFT:

class func snapshot(geoCoordinates coordinates: NMAGeoCoordinates, zoomLevel zoom: Float, orientation: Float, size: CGSize, _ resultBlock: @escaping (UIImage) -> Void)

Refer this link for more details :

https://developer.here.com/documentation/ios-premium/api_reference_jazzy/Classes/NMAMapView.html#%2Fc:objc(cs)NMAMapView(cm)snapshotWithGeoCoordinates:zoomLevel:orientation:size:block :

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM