-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add options for toggling buildings, traffic, POIs in Mapbox Streets–sourced styles #8071
Comments
One thorny issue is what the getter’s default value should be and what the getter and setter should do in the event of a mixed state (some relevant layers shown, some hidden). |
#11726 proposes a similar inspectable for label localization. |
For the inspectable specifically, Interface Builder represents a Boolean property as a three-way option, with “Default Value” corresponding to the natural state where the setter is never called. So the question of a default value is only thorny for the public property but not the inspectable. The public property could have a non-Boolean type, like MapKit’s three-way |
@1ec5 the traffic style is enabled by default. If someone uses: I'm not sure this IBInspectable would be necessary at all. Unless when setting the property Or maybe just left it as a convenience method for navigation. |
It’s important to distinguish between the Traffic source and the Traffic Day/Night styles. As seen in the Traffic plugin, any style can have traffic congestion lines powered by the Traffic source; no reloading is required. We could treat these inspectables as a way to force certain things on or off. When an inspectable is in its default state, we would leave the style untouched, so the Traffic Day style would have traffic by default, but the Streets style would not. On the other hand, when the inspectable is on, both styles would have traffic layers. That said, some of these options, including traffic, could be problematic because we don’t necessarily know what would look good atop an arbitrary style. So we could scope down this feature even further: the inspectables would only hide certain layers but not create any layers on its own. |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
MGLStyle should have
showsBuildings
,showsTraffic
, andshowsPointsOfInterest
properties that toggle the visibility of relevant layers in any style that uses the Mapbox Streets and/or Mapbox Traffic sources. These properties would help us achieve parity with the similarly named MKMapView properties in MapKit and theGMSMapView.buildingsEnabled
andGMSMapView.trafficEnabled
properties in the Google Maps SDK for iOS.showsBuildings
would toggle the visibility of any MGLFillStyleLayer or MGLFillExtrusionStyleLayer whose source’s URL ismapbox.mapbox-streets-v7
and whosesourceLayerIdentifier
isbuilding
.showsTraffic
would toggle the visibility of any MGLLineStyleLayer whose source’s URL ismapbox://mapbox.mapbox-traffic-v1
.showsPointsOfInterest
would toggle the visibility of any MGLSymbolStyleLayer whose source’s URL ismapbox.mapbox-streets-v7
and whosesourceLayerIdentifier
ispoi_label
.We should also add corresponding IBInspectable properties to the MGLMapView(IBAdditions) category for parity with MapKit:
This feature would obviate mapbox/ios-sdk-examples#64.
/cc @bsudekum @frederoni @pveugen
The text was updated successfully, but these errors were encountered: