Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Image Artifacts Remain After Adding/Removing Symbol Layer #9249

@otmanskim

Description

@otmanskim

We're trying to add and remove "image" layers (they are actually MGLSymbolStyleLayer's), using the workaround detailed here. We have added a UIButton that will add and remove the image layer as appropriate when tapped. We are removing the images by removing the source, layer, and imageName from the map's style:

style.removeSource(source)
style.removeLayer(layer)
style.removeImage(forName: overlay.identifier)

The issue we are seeing is after removal, if we zoom in or out, when we re-add the layer, this time the image appears distorted, as though artifacts of the old image are still present on the map. Screenshots attached.

Original Image:
original image

Image after removing, zooming, and re-adding:
after removing zooming and readding

Platform: iOS (10)
Mapbox SDK version: 3.5.4

Steps to trigger behavior

  1. Implement the workaround to add an image layer to the map, as described here: Support "image" source type #1350 (comment)
  2. Also implement removal / re-adding of the image layer
  3. Run the app to add the image the first time
  4. Remove the image layer from the map's style (via button or other added interface)
  5. Zoom the map in or out
  6. Re-add the image layer (via button or other added interface)
  7. Notice extra border around the edges of the image looks like part of the original image

Expected behavior

The image should appear the same the second time it's added as it did the first time.

Actual behavior

The image appears distorted and artifacts from the original one remain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugiOSMapbox Maps SDK for iOS

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions