Skip to content

ArgumentError when calling _tileStore.setMapboxAPIUrl with Uri #851

@tchengck

Description

@tchengck

Description:
I encountered an issue when calling _tileStore.setMapboxAPIUrl(Uri.parse('https://api.mapbox.com/'));. This results in the following exception:

ArgumentError (Invalid argument: Instance of '_SimpleUri')

Steps to Reproduce:

  1. Call _tileStore.setMapboxAPIUrl(Uri.parse('https://api.mapbox.com'));
  2. Observe the exception being thrown.

Expected Behavior:

The function should accept the parsed URI and not throw an ArgumentError.

Actual Behavior:

The function throws ArgumentError (Invalid argument: Instance of '_SimpleUri').

Possible Cause:

It seems like _tileStore.setMapboxAPIUrl might be expecting a String instead of a Uri object, as described in its documentation: "Accepts a string, or null for resetting to the default value." If this is the case, the method should ensure proper type handling.

Environment:

  • Package Version: 2.5.1
  • Platform: Android and iOS

Additional Context:

Any insights into whether this is an expected behavior or a bug would be appreciated. If _tileStore.setMapboxAPIUrl is meant to accept a Uri, it might need an update to handle this exception properly.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions