Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Removing source on web #525

Open
R-3MY opened this issue Nov 19, 2024 · 0 comments
Open

[BUG] Removing source on web #525

R-3MY opened this issue Nov 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@R-3MY
Copy link

R-3MY commented Nov 19, 2024

Platforms

web

Version of flutter maplibre_gl

0.20.0

Bug Description

It seem to be impossible to delete a source on web.

Steps to Reproduce

  1. Create MapLibreMap
  2. Add source
  3. Delete source
  4. Add again source with same name

Expected Results

Source is deleted

Actual Results

Source isn't deleted

Code Sample

Future<void>? refreshClusteredPointSource(String sourceId, Object? data, bool delete) async {
    if (delete) {
      debugPrint("DELETING SOURCE");
      try {
        await mapController!.removeSource(sourceId);
      } catch (e) {
        debugPrint("error removing source : $e");
      }
      debugPrint("DELETING SOURCE END");
    }
    debugPrint("ADDING SOURCE");
    await mapController!.addSource(sourceId, GeojsonSourceProperties(data: data, cluster: true, clusterMaxZoom: 12, clusterRadius: 50));
    debugPrint("ADDING SOURCE END");
  }

Console

DELETING SOURCE
null
DELETING SOURCE END
ADDING SOURCE
Error: Source "markers_source" already exists.
@R-3MY R-3MY added the bug Something isn't working label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant