src/mbgl/text/collision_feature.hpp
CollisionFeature(const GeometryCoordinates& line,
                     const Anchor& anchor,
                     optional<PositionedIcon> shapedIcon,
                     const float boxScale,
                     const float padding,
                     const IndexedSubfeature& indexedFeature_,
                     const float rotate)
        : CollisionFeature(line,
                           anchor,
                           (shapedIcon ? shapedIcon->top() : 0),
                           (shapedIcon ? shapedIcon->bottom() : 0),
                           (shapedIcon ? shapedIcon->left() : 0),
                           (shapedIcon ? shapedIcon->right() : 0),
                           (shapedIcon ? shapedIcon->collisionPadding() : optional<Padding>{nullopt}),
                           boxScale,
                           padding,
                           style::SymbolPlacementType::Point,
                           indexedFeature_,
                           1,
                           rotate) {}
// for icons
// Icons collision features are always SymbolPlacementType::Point, which means the collision feature
// will be viewport-rotation-aligned even if the icon is map-rotation-aligned (e.g. `icon-rotation-alignment: map`
// _or_ `symbol-placement: line`). We're relying on most icons being "close enough" to square that having
// incorrect rotation alignment doesn't throw off collision detection too much.
// See: https://github.com/mapbox/mapbox-gl-js/issues/4861
for icons
Icons collision features are always SymbolPlacementType::Point, which means the collision feature
will be viewport-rotation-aligned even if the icon is map-rotation-aligned . We're relying on most icons being "close enough" to square that having
incorrect rotation alignment doesn't throw off collision detection too much.
for icons Icons collision features are always SymbolPlacementType :: Point which means the collision feature will be viewport - rotation - aligned even if the icon is map - rotation - aligned . We ' re relying on most icons being " close enough " to square that having incorrect rotation alignment doesn ' t throw off collision detection too much .
CollisionFeature(const GeometryCoordinates& line,
                     const Anchor& anchor,
                     optional<PositionedIcon> shapedIcon,
                     const float boxScale,
                     const float padding,
                     const IndexedSubfeature& indexedFeature_,
                     const float rotate)
        : CollisionFeature(line,
                           anchor,
                           (shapedIcon ? shapedIcon->top() : 0),
                           (shapedIcon ? shapedIcon->bottom() : 0),
                           (shapedIcon ? shapedIcon->left() : 0),
                           (shapedIcon ? shapedIcon->right() : 0),
                           (shapedIcon ? shapedIcon->collisionPadding() : optional<Padding>{nullopt}),
                           boxScale,
                           padding,
                           style::SymbolPlacementType::Point,
                           indexedFeature_,
                           1,
                           rotate) {}
CollisionFeature ( const GeometryCoordinates & line , const Anchor & anchor , optional < PositionedIcon > shapedIcon , const float boxScale , const float padding , const IndexedSubfeature & indexedFeature_ , const float rotate ) : CollisionFeature ( line , anchor , ( shapedIcon ? shapedIcon -> top ( ) : 0 ) , ( shapedIcon ? shapedIcon -> bottom ( ) : 0 ) , ( shapedIcon ? shapedIcon -> left ( ) : 0 ) , ( shapedIcon ? shapedIcon -> right ( ) : 0 ) , ( shapedIcon ? shapedIcon -> collisionPadding ( ) : optional < Padding > { nullopt } ) , boxScale , padding , style :: SymbolPlacementType :: Point , indexedFeature_ , 1 , rotate ) { }
for icons
Icons collision features are always SymbolPlacementType::Point, which means the collision feature
will be viewport-rotation-aligned even if the icon is map-rotation-aligned (e.g.
for icons Icons collision features are always SymbolPlacementType :: Point which means the collision feature will be viewport - rotation - aligned even if the icon is map - rotation - aligned ( e . g .