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] placeholderImage doesn't work #1244

Closed
3 tasks done
Farrukh1198 opened this issue May 22, 2022 · 11 comments
Closed
3 tasks done

[BUG] placeholderImage doesn't work #1244

Farrukh1198 opened this issue May 22, 2022 · 11 comments
Labels
bug This issue reports broken functionality or another error

Comments

@Farrukh1198
Copy link

Farrukh1198 commented May 22, 2022

Describe The Bug
I want to show my custom tile image while tile is loading. For this purpose I use placeholderImage option of TileLayerOptions but I still get grey tiles instead of my image.

Expected Behavior
I expected my custom tiles to be shown while map tiles are loading

Screenshots & Recordings
I think it's clear without screenshots


Doctors Report

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.0.0, on Microsoft Windows [Version 10.0.14393], locale ru-RU)
[!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2021.1)
[√] VS Code (version 1.67.2)
[√] Connected device (3 available)
[√] HTTP Host Availability

To Reproduce
Steps to reproduce the behavior:

My code is

                TileLayerOptions(
                  updateInterval: 100,
                  placeholderImage: Image.asset('uploads/tile.png').image,
                  urlTemplate:
                      "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
                  subdomains: ['a', 'b', 'c'],
                )

Severity
This will help us to label the issue quicker and decide what needs attention first. Only choose fatal if the entire app crashes, otherwise choose non-fatal.

  • Non-Fatal

Frequency/Rarity
This will help us to label the issue quicker and decide what needs attention first.

  • Always

Applicable Platforms
Only select those that you've tested on - one or more. If possible, test on a variety of platforms.

  • Android
@Farrukh1198 Farrukh1198 added bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing labels May 22, 2022
@JaffaKetchup
Copy link
Member

Hi there,

Do you get any errors trying to retrieve the image? Can you get the same image from other places in the app?

If those show no apparent issues, try this instead of your current method of getting the image:

// Image.asset('uploads/tile.png').image
AssetImage('uploads/tile.png')

Let me know if anything shows up!

@Farrukh1198
Copy link
Author

Hi there,

Do you get any errors trying to retrieve the image? Can you get the same image from other places in the app?

If those show no apparent issues, try this instead of your current method of getting the image:

// Image.asset('uploads/tile.png').image
AssetImage('uploads/tile.png')

Let me know if anything shows up!

I don't get any errors. But grey tile shows up instead of my image like placeholderImage doesn't exist

@JaffaKetchup
Copy link
Member

OK. I'm assuming that the same image can be loaded elsewhere in the app? This would be good to check.
If it can be, maybe try a MemoryImage and copy in some raw data just for testing?

@Farrukh1198
Copy link
Author

OK. I'm assuming that the same image can be loaded elsewhere in the app? This would be good to check. If it can be, maybe try a MemoryImage and copy in some raw data just for testing?

Hi. Thanks for your reply. The same image loaded inside or using other widgets. But to my great regret, I could not deal with MemoryImage, for which I feel uncomfortable in front of you.

@JaffaKetchup
Copy link
Member

JaffaKetchup commented May 24, 2022

Nah, no need to be uncomfortable! Everyone has somethings they can't do, and I'm here to help (along with other maintainers) :). Maybe in the future you will be the best at Flutter!

In this case, I'll have to do some deeper digging and try to reproduce myself. Thanks for the info, it helps me to get to the bottom of the issue better!

@ibrierley
Copy link
Collaborator

I think actually placeholderImage has become deprecated ? Someone tell me I'm not going mad! Just noticed this when I was surprised I couldn't find it in the code being used....

#572 (comment)

@JaffaKetchup
Copy link
Member

That's interesting, does anything say why it was deprecated? Seems like useful functionality to me!

@Farrukh1198
Copy link
Author

Indeed, it helps a lot to highlight your brand and product.

@Farrukh1198
Copy link
Author

Farrukh1198 commented May 24, 2022

Nah, no need to be uncomfortable! Everyone has somethings they can't do, and I'm here to help (along with other maintainers) :). Maybe in the future you will be the best at Flutter!

In this case, I'll have to do some deeper digging and try to reproduce myself. Thanks for the info, it helps me to get to the bottom of the issue better!

I do appreciate your efforts to help me. And thank you for your wishes!

@JaffaKetchup
Copy link
Member

Hi there,
With the release of v1.0.0, we've deprecated this feature for now within the codebase. For this feature to return it will need to be recreated from scratch.

@JaffaKetchup
Copy link
Member

Thanks for your report!

@JaffaKetchup JaffaKetchup removed the needs triage This new bug report needs reproducing and prioritizing label Jun 7, 2022
@JaffaKetchup JaffaKetchup changed the title [BUG] placeholderImage doesn't work [BUG] placeholderImage doesn't work Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue reports broken functionality or another error
Projects
None yet
Development

No branches or pull requests

3 participants