0

I have a customized location icon in Mapbox (iOS SDK v10.10) using the documentation here: [https://docs.mapbox.com/ios/maps/api/10.12.0/Structs/Puck2DConfiguration.html#/s:10MapboxMaps19Puck2DConfigurationV8topImageSo7UIImageCSgvp]

By removing the bearing image and setting my icon as top image, the icon shows correctly at the user location.

However, the white ring used below the original blue dot still shows. I do not want to make my icon bigger to hide the white ring, I want to remove the white ring.

This is how I set up my Puck2DCOnfiguration:

private static var ownLocationConfiguration: Puck2DConfiguration = {
        var config = Puck2DConfiguration.makeDefault(showBearing: false) // The icon will rotate, no need to show bearing arrow
        let symbolConfig = UIImage.SymbolConfiguration(pointSize: 45, weight: .thin)
        var icon = UIImage(systemName: "airplane", withConfiguration: symbolConfig)?.withTintColor(AppColor.companyColor)
        icon = icon?.rotate(radians: -Float.pi / 2)
        config.topImage = icon
        config.bearingImage = nil
        config.shadowImage = nil
        config.pulsing = nil
        config.showsAccuracyRing = false
        return config
    }()

Setting shadowImage to nil should remove the white "bottom" part of the configuration.

I have also tried setting shadowImage to an empty UIImage(), but that crashes Mapbox.

Any ideas?

0 Answers0