ThinkGeo.com    |     Documentation    |     Premium Support

ThinkGeo MAUI Issue With Loading Google Map

Hi Thenish,

I recreated this issue on Android on both tablet and pixel 5, even the same project works fine on Windows and iOS (both iPhone and iPad). I also see the project works fine on Android if I use the latest stable package SkiaSharp.Extended.UI.Maui 2.0 or just remove it.

Apparently, that’s a bug in SkiaSharp.Extended.UI.Maui version 3.0.0-preview.7. I dug in a bit and I found it does have issues when saving a Skia bitmap to a png stream in some cases. It’s OK if save it as a Jpeg stream.

As a result, I added LayerOverlay.ImageFormat to the latest beta ThinkGeo.UI.Beta 14.2.0-beta006. Just add the following line to the code and the google background showed as expected. Please be aware though this is kind of a work around and the best solution SkiaSharp.Extended.UI.Maui fixed it on their side.

  LayerOverlay.ImageFormat = GeoImageFormat.Jpeg; 

And 2 quick updates here:

  1. Google replied and they don’t want to provide a premium account just for test.
  2. ThinkGeo Sales sent you an email regarding account, did you have a chance to read/reply?

Thanks,
Ben

Hi Ben,

Thanks for updated version of ThinkGeo.UI.Beta 14.2.0-beta006 using the image format property I was able to load google map successfully in android emulators, Also the issue with premium key is also resolved now I am able to load up the google maps even using the premium key and all map types satellite, road and hybrid are working fine.

Two issues I found while my testing

  1. I am seeing is the side bars in this version are shown as black is there any property that I can set to change it to white ? I tried setting background for overlay but that does not seems to work. Can it be changed to white ?

  2. If I am drawing line or polygon on any other layer its not showing up also any points added on different layer are now not showing.

  3. This sort of issues I am just seeing in android 13 and 14. I have other device with Android 11 and on it everything seems to be working fine.

ThinkGeo Sales sent you an email regarding account, did you have a chance to read/reply?

I don’t have access to email that is used in this account can you please send that mail to all the participants present in teams call that we had 2 week before as licensing is being managed by different team.

Thanks.

Hi Thenish,

Here are some answers/questions to your questions:

  1. That’s a side effect of jpeg which doesn’t support transparency. Don’t you guys have a premium google account which returns up to 2048 * 2048 image? It will not have this black border with the premium account.

  2. Do you mean it worked before but stopped working since beta006? or it stopped working since SkiaSharp.Extended.UI.Maui version 3.0.0-preview.7? Make sure to draw the line/polygons on an overlay with LayerOverlay.ImageFormat = GeoImageFormat.Png

  3. Thanks for letting us know.

And I will let my colleague know about the account stuff.

Thanks,
Ben

Hi Ben,

  1. In some places I am getting low size images even with premium key that is why zooming to certain location I am getting black bars.
  2. earlier map was not loading on android 13 and 14 devices so I did not notices but seems like glide exception is thrown at overlay level so all the overlays I am using are throwing glide exception now after adding SkiaSharp.Extended.UI.Maui version 3.0.0-preview.7
  3. Since google is not providing the key to test is there any other way you can fix this map load issues with premium keys that too without adding any libraries.

Hi Thenish,

  1. For the black bar issue, can you add the following code, restart the project and find the google request link in the output window, open that link in a browser and verify if the resolution of the returned image matches the request?

    ThinkGeoDebugger.LogLevel = ThinkGeoLogLevel.All;
    ThinkGeoDebugger.LogType = ThinkGeoLogType.WebRequest;
    
  2. That com.bumptech.glide exception comes from SkiaSharp.Extended.UI.Maui version 3.0.0-preview.7 instead of ThinkGeo. It will be gone after removing it. You first mentioned this Glide exception 14 days ago, which implies you guys were using that preview.7 package from the very beginning, right?

  3. I don’t have a good way to test google premium key, but I have a feeling all the issue comes from that SkiaSharp.Extended.UI.Maui version 3.0.0-preview.7 package. Can you remove that package from your project and have another try?

Thanks,
Ben

Hi Ben,

We were not using this package earlier and we get same issue with glide in empty project with just think geo library in fact the project that I shared with you earlier don’t even use this library. I shared this library because I was getting same exceptions after using library with free key thinking that may help you to resolve the issue without premium key as both exception I was getting were pretty much the same.

So just to be clear glide exception gets thrown even when we don’t use SkiaSharp.Extended.UI.Maui package with premium key and project I showed you in our call was just having thinkgeo package.

Hi Thenish,

I see. I’m wondering do you see that glide exception running ThinkGeo HowDoI ThinkGeo / Public / Mobile Maps · GitLab? I never saw it before but not sure if that’s the same case on your side?

If you don’t see that glide exception in HowDoI but do see it in your test project using Google premium key, can you change it to google regular key see if you can see the same problem? If yes, please send me the test project.

Let me know if you only see this exception when using Google premium key but not regular key. That will be interesting.

You think it’ll be more convenient we have another meeting? can you contact support@thinkgeo.com and schedule a meeting maybe early next week?

Thanks,
Ben

Hi Ben,

I was able to reproduce issue with map in HowDoI sample. Issue just happens when I use premium key. When using free key map load fine. adding screenshot of emulator when using free key vs using paid key.

HowDoI Sample with Free Key

  1. ThinkGeo Message - 13:53:21.6172267: Fetched Image from Google Maps Server: Width:1280 Height:1280; location: (-8236046.603090543, 4975306.6333812745); stretched: (924, 924); requestedImageScale: 144448.0055363297, currentScale: 99974.03736415747

HowDoI Sample with Paid Key

  1. ThinkGeo Message - 13:48:17.9008797: Fetched Image from Google Maps Server: Width:2048 Height:2048; location: (-8236046.603090543, 4975306.6333812745); stretched: (1479, 1479); requestedImageScale: 144448.0055363297, currentScale: 99974.03736415747

  2. [Glide] Load failed for [crc6488302ad6e9e4df1a.ImageLoaderCallback@f3f6755] with dimensions [2401x2401]

You think it’ll be more convenient we have another meeting? can you contact support@thinkgeo.com and schedule a meeting maybe early next week?

Sure will ask team here to contact support for scheduling another meeting based on availability of both sides.

Thanks for the meeting just now. Here I am closing this thread as we are transferring to the emails.

Hi Ben,

Thanks for providing the fix after using WebBasedTileOverlay I am able to load map successfully on all devices with premium key also performance is greatly improved and map now takes up whole device space no matter how big is the device. we are still testing all scenarios on different set of devices will let you know if something comes up.

Awesome! Also just FYI, the latest version not only improved the performance of GoolgeMap, it also improved the performance for tile-based web layers (such as OpentreetMaps, WMTS, ThinkGeoRasterTiles, etc) as well as loading local cache tiles. Just let us know if you see any more issues.

1 Like