在Mapbox中，如何从iOS上的样式切换图层？(In Mapbox how can you toggle layers from a style on iOS?)
但我无法弄清楚如何在Xcode中将这个文件与地图视图一起使用。 任何人都可以给我任何有关如何完成的信息？ 或者是否有可能？
只是一些背景设置，我有一个mapview创建和运行良好。 然后我有许多GPX路径已经导出到TileSets并添加到一个样式作为一个层。 我有一个名为'where_trail'的图层，我想用按钮打开和关闭。 目前，所有图层都在地图上绘制，我无法弄清楚如何访问图层并隐藏它们。 任何人都可以为我提供一些指导吗？
I'm trying to toggle layers in iOS for MapBox but can't figure out how it's done. I've been looking at this example:
But I can't figure out how to use this file with the map view in Xcode. Can anyone give me any info on how this is done? Or whether it's possible?
Just a bit of background on the setup, I have a mapview created and running fine. I then have numerous GPX trails which have been exported in to TileSets and added to a style as a layer. I have a layer called 'where_trail' which I want to toggle on and off with a button. Currently all the layers are drawing on the map, I just can't figure out how to access the layers and hide them. Can anyone offer me some guidance on this please?
目前还没有完整的iOS框架切换样式示例，但要注意的属性是styleURL - 您可以将该地图属性的值分配给新的NSURL，您可以从Studio或从默认的风格。 将其连接到一个动作，它应该完全符合您的要求。
There isn't yet a full-fledged example of switching styles for the iOS framework, but the property to pay attention to is the styleURL - you can assign the value of that map property to a new NSURL, which you can get from Studio or from a default style. Wire this up to an action and it should do exactly what you're looking for.