Skip to content

Cannot be removed while layer is using it #131

@jcmidia

Description

@jcmidia

When changing the persistent setting to false, everytime I leave the page where I have a map with a source and some lines I get this error on my console:
mapbox-gl.js?v=b74edb5e:859 Error: Source "itinerary-0c22573d-67f8-487e-9a20-3315afd64933" cannot be removed while layer "routes-layer" is using it.

This is how I'm using the Mapbox component:

<MapboxMap
            :map-id="mapId"
            :options="mapOptions"
            style="position: absolute; top: 0; bottom: 0; left: 0; width: 100%"
          >
            <MapboxSource
              :source-id="mapId"
              :source="{ type: 'geojson', data: geojsonSource, promoteId: 'id' }"
            />
  
            <MapboxLayer
                :layer="{
                  source: sourceId,
                  id: layerId,
                  type: 'line',
                  paint: {
                    'line-color': '#FFFFFF',
                    'line-width': 7,
                  },
                }"
              />
 </MapboxMap>

Any ideas how I can fix that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions