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

[Android] SDF images are colored as defined when adding image to controller but not when referenced directly when adding symbol #1251

Closed
assemblethis opened this issue Dec 26, 2022 · 1 comment
Labels

Comments

@assemblethis
Copy link

I noticed that the following code doesn't work for SDF images that need to be colored:

    final symbol = await mapController?.addSymbol(
        SymbolOptions(
          geometry: LatLng(latitude, longitude),
          iconImage: 'assets/images/winterbolt.png',
          iconSize: 0.5,
          iconColor: 'red',
        )
    );

But the following does work and correctly colors the image red:

      final bytes = await rootBundle.load('assets/images/winterbolt.png');
      final list = bytes.buffer.asUint8List();
      await mapController?.addImage('winterbolt', list, true);

      // place Symbol
      final symbol = await mapController?.addSymbol(
        SymbolOptions(
          geometry: LatLng(latitude, longitude),
          iconImage: 'winterbolt',
          iconSize: 0.5,
          iconColor: 'red',
        ),
      );

Maybe the solution is just to add a parameter for SDF to addSymbol?

@assemblethis assemblethis changed the title SDF images work on Android when adding image to controller but not when referenced directly when adding symbol SDF images are colored as defined on Android when adding image to controller but not when referenced directly when adding symbol Dec 26, 2022
@assemblethis assemblethis changed the title SDF images are colored as defined on Android when adding image to controller but not when referenced directly when adding symbol [Android] SDF images are colored as defined when adding image to controller but not when referenced directly when adding symbol Dec 26, 2022
@stale
Copy link

stale bot commented Feb 25, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 25, 2023
@stale stale bot closed this as completed Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant