在这里地图 - 地图快照是黑色一个一个黑色的矩形(Premium SDK)

发布于 2025-02-10 20:39:09 字数 426 浏览 0 评论 0 原文

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

通过使用此代码,我将其变黑:

怎么了? (它以前起作用,而不是在客户端进行的更改)。 这里通过Cocoapods映射SDK(3.20.2)。

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:
enter image description here

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

神魇的王 2025-02-17 20:39:09

创建具有指定尺寸和位置的临时地图视图,然后将其渲染到UIIMAGE-屏幕上没有任何内容。

此类方法用于创建地图的静态图像。快照将具有与等效的NMAMAPVIEW具有相同的地理中心,变焦,方向和框架尺寸相同的视觉外观。

一次只能处理一个快照,但是任何数字都可以通过连续调用此方法排队。快照将按照收到的顺序进行处理。

与SnapshotWithBlock不同,该方法在应用程序背景时永远不会采用快照。如果应用在后台,则将延期快照,直到应用程序再次进入前景为止。

如果尚未下载,此方法将下载指定区域所需的地图数据,因此,对于未下载映射数据的区域,快照将需要更长的时间才能完成。
声明目标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)

有关更多详细信息,请参阅此链接:

https://developer.here.com/documentation/ios-premium/api_reference_jazzy/Classes/NMAMapView.html#%2Fc:objc(cs )nmamapview(cm)snapshotwithgeocoordinates:zoomlevel:entirentation:size:size:block

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:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文