We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I cannot change GeoJSONSource's clusterMaxZoom property on the fly
style.setSourceProperty(for: "people", property: "clusterMaxZoom", value: 12.0)
Getting the following error:
MapboxMaps.StyleError(rawValue: "Cannot set property clusterMaxZoom for the source people")
Update clusterMaxZoom on the fly.
Tried setting the value with NSNumber or just
style.setSourceProperty(for: "people", property: "clusterMaxZoom", value: style.getStyleSourceProperty(forSourceId: "people", property: "clusterMaxZoom").value)
got same error
Complete controller to reproduce:
class ViewController: UIViewController { internal var mapView: MapView! func buildView(_ color: UIColor = UIColor.red) -> UIView { let view = UIView(frame: CGRect(x:0,y:0,width:40,height:40)) view.backgroundColor = color return view; } override func viewDidLoad() { super.viewDidLoad() let myResourceOptions = ResourceOptions(accessToken:accessTokenSch) let myMapInitOptions = MapInitOptions(resourceOptions: myResourceOptions, styleURI: StyleURI.streets) mapView = MapView(frame: view.bounds, mapInitOptions: myMapInitOptions) mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight] self.view.addSubview(mapView) mapView.mapboxMap.onNext(.styleLoaded) { _ in var source = GeoJSONSource() let center = LocationCoordinate2D(latitude: 59.879647222152855, longitude: 30.319378097536216) source.data = .geometry(Geometry.point(Point.init(center))) source.clusterRadius = 20.0 let mapboxMap = self.mapView.mapboxMap! try! mapboxMap.style.addSource(source, id: "people") try! mapboxMap.style.setSourceProperty(for: "people", property: "clusterMaxZoom", value: 12.0) var layer = CircleLayer(id: "accuracy") layer.source = "people" let radius = 20.0 layer.circleRadius = .constant(radius) layer.circleRadiusTransition = .init(duration: 2.0, delay: 0.0) layer.circleOpacity = .constant(0.5) try! mapboxMap.style.addLayer(layer) self.mapView.camera.fly(to: CameraOptions(center: CLLocationCoordinate2D(latitude: 59.879647222152855, longitude: 30.319378097536216), zoom: 10.0 )) } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Environment
Observed behavior and steps to reproduce
I cannot change GeoJSONSource's clusterMaxZoom property on the fly
Getting the following error:
Expected behavior
Update clusterMaxZoom on the fly.
Notes / preliminary analysis
Tried setting the value with NSNumber or just
got same error
Additional links and references
Complete controller to reproduce:
The text was updated successfully, but these errors were encountered: