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

MGLFillStyleLayer partially disappear when zooming in #627

Open
VasylKhmil opened this issue Aug 31, 2021 · 1 comment
Open

MGLFillStyleLayer partially disappear when zooming in #627

VasylKhmil opened this issue Aug 31, 2021 · 1 comment
Labels

Comments

@VasylKhmil
Copy link

Environment

  • Xcode version:
  • iOS version: 12.5
  • Devices affected: iPhone XR
  • Maps SDK Version: v6.3.0

Observed behavior and steps to reproduce

Some polygons rendered by MGLFillStyleLayer partially disappear on certain zoom levels.
When adding a polygon as an annotation - everything works, but rendering via layer - creating this issue.
Tested with different settings(max zoom level, min zoom level, adding layer on top, removing opacity), but nothing helps.

Interesting that it happens only if polygon is in area with a huge list of elements on map.

Take a look on video and code sample.

           let polygon = MGLPolygon(
                coordinates: region.polygon, 
                count: UInt(region.polygon.count)
            )
            
            let source = MGLShapeSource(
                identifier: region.identifier, 
                shape: polygon
            )
            
            let layer = MGLFillStyleLayer(
                identifier: region.identifier, 
                source: source
            )
            
            layer.fillColor = NSExpression(forConstantValue: region.color.withAlphaComponent(0.2))
            layer.fillOutlineColor = NSExpression(forConstantValue: region.color)
                
            style.addSource(source)
            
            if let buildingLayer = style.layer(withIdentifier: Constants.Map.Layer.buildingId) {
                style.insertLayer(layer, below: buildingLayer)
            }
            else {
                style.addLayer(layer)
            }

https://drive.google.com/file/d/1d5DmcVUdOy2z0pL2KEG8vI4c5DBdgj6B/view?usp=sharing

Expected behavior

I expect some way of giving map priority of a layer drawing to avoid this issue.

@macdrevx macdrevx transferred this issue from mapbox/mapbox-maps-ios Sep 1, 2021
@macdrevx
Copy link
Contributor

macdrevx commented Sep 1, 2021

Transferred to the pre-v10 repo

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

No branches or pull requests

2 participants