A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Esri/arcgis-maps-sdk-swift-toolkit/issues/802 below:

unexpected exception · Issue #802 · Esri/arcgis-maps-sdk-swift-toolkit · GitHub

Hello everybody,

we currently have the issue, that there often occurs an exception when using Scalebar:

"onChange(of: Optional) action tried to update multiple times per frame."

In stacktrace we can see that the exception is thrown in Scalebar.swift:

Scalebar.swift

.onChange(of: spatialReference) { viewModel.update($0) }
.onChange(of: unitsPerPoint) { viewModel.update($0) }
.onChange(of: viewpoint) {
    viewModel.update($0) --> Issue here
    viewModel.updateScale()
    if settings.autoHide {
        withAnimation {
            opacity = 1
        }
        withAnimation(.default.delay(settings.autoHideDelay)) {
            opacity = .zero
        }
    }
}

ScalebarViewModel.swift

func update(_ viewpoint: Viewpoint?) {
    self.viewpoint = viewpoint
    if !initialScaleWasCalculated { updateScale() } --> Issue here
}

Generally its working correctly, and we have implemented it as shown in the example. But this exception occurs. Do you know this behaviour or do you have any idea why this happens?

Thank you
Marvin


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4