简体   繁体   English

HERE 地图 - 地图快照是黑色矩形(Premium SDK)

[英]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. HERE Maps SDK (3.20.2) 通过 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.创建一个具有指定大小和位置的临时地图视图,然后将其渲染到 UIImage - 没有任何内容渲染到屏幕上。

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.快照将具有与具有相同地理中心、缩放、方向和帧大小的等效 NMAMapView 相同的视觉外观。

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.与 snapshotWithBlock: 不同,此方法在应用程序处于后台时永远不会拍摄快照。 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:声明目标 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 : https://developer.here.com/documentation/ios-premium/api_reference_jazzy/Classes/NMAMapView.html#%2Fc:objc(cs)NMAMapView(cm)snapshotWithGeoCoordinates:zoomLevel:orientation:size:block

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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