Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Clustered MGLSymbolStyleLayer is not showing when offline #654

Open
anilios opened this issue May 13, 2022 · 1 comment
Open

Clustered MGLSymbolStyleLayer is not showing when offline #654

anilios opened this issue May 13, 2022 · 1 comment

Comments

@anilios
Copy link

anilios commented May 13, 2022

When using mapbox offline, clustered MGLSymbolStyleLayer is not visible since fonts are being downloaded from style url. Is there a way to use local fonts in iOS app.

Following is the code for creating that layer
let numbersLayer = MGLSymbolStyleLayer(identifier: "clusteredPortsNumbers", source: source) numbersLayer.textColor = NSExpression(forConstantValue: UIColor.white) numbersLayer.textFontSize = NSExpression(forConstantValue: NSNumber(value: Double(icon.size.width) / 4)) //numbersLayer.textFontNames = NSExpression(forConstantValue: ["OpenSans-Medium"]) numbersLayer.iconAllowsOverlap = NSExpression(forConstantValue: true) numbersLayer.text = NSExpression(format: "CAST(point_count, 'NSString')") numbersLayer.predicate = NSPredicate(format: "cluster == YES") self.mapView.style?.addLayer(numbersLayer)

Steps to reproduce

  1. Use map box offline
  2. Clustered MGLSymbolStyleLayer is not visible due to fonts beind failed to download from style url.

Expected behavior

Allow using ios system fonts in offline case.

Actual behavior

Not able to use offline fonts, layers do not show up with clustering and having text on them.

Configuration

Mapbox SDK versions:
iOS/macOS versions:
Device/simulator models:
Xcode version:

@anilios
Copy link
Author

anilios commented May 27, 2022

I am still stuck with this problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant