martykan / forecastie

A simple, opensource weather app for Android.
Other
871 stars 338 forks source link

Maps do not show #537

Closed bbbhltz closed 4 years ago

bbbhltz commented 4 years ago

I don't have any maps on my new phone. I don't think it is a big deal because I don't really use the maps feature. I am using a new phone configured the same as my older phone but have jumped from Android 8 to 10.

I have applied the Universal Android Debloater on both of my phones if that is of interest.

Screenshot_20200925-235833

robinpaulson commented 4 years ago

I don't get any maps either. I will investigate more, although I don't recall making any map-related changes in the burst of activity over the last few weeks. Perhaps it's related to our API Key, we might have hit a limit?

robinpaulson commented 4 years ago

@pasdechance To be clear, did you use Forecastie previously? It sounds like this bug first manifested when you got a different phone, with a different version of Android.

bbbhltz commented 4 years ago

It is just on this phone (Nokia 5.3 Android 10), my 2 older phones with older versions of Android work.

robinpaulson commented 4 years ago

Also: "Il N'a Pas De Chance"?

bbbhltz commented 4 years ago

Also: "Il N'a Pas De Chance"?

Squarepusher

robinpaulson commented 4 years ago

Perhaps we did not fully take into account what SDK29/AndroidX would mean, there may now be more restrictions on what we can do with Webview.

robinpaulson commented 4 years ago

@fantel, given you did the SDK29/AndroidX upgrade, would you be able to glance over this? Thanks

fAntel commented 4 years ago

I'll look at this. On my Nokia 6.2 with Android 10 maps are visible but rain, temperature and so on aren't.

robinpaulson commented 4 years ago

I'll look at this. On my Nokia 6.2 with Android 10 maps are visible but rain, temperature and so on aren't.

I'm not sure what you mean. Are you saying the OSM map underlay shows up, but the coloured overlays for the weather do not?

fAntel commented 4 years ago

Yes, the OSM map underlay shows up, but the coloured overlays for the weather do not. But I think it may be connected.

robinpaulson commented 4 years ago

That's interesting, I don't get anything, same as the OP.

FridoDeluxe commented 4 years ago

With the latest version from repository it's the same for me: OSM map tiles show up, but no OWM overlays. This is the log output:

I/chromium: [INFO:CONSOLE(97)] "Uncaught ReferenceError: NativeInterface is not defined", source: file:///android_asset/map.html?lat=XXX&lon=YYY&appid=ZZZ&zoom=7 (97)

Looks like the object NativeInterface in line 97 of the map.html file is unknown to WebView. Also I wasn't able to find anywhere the implementation of both methods NativeInterface.transferLatLon() and NativeInterface.transferZoom() which are apparently called by JavaScript.

Does someone know the App's revision where the map still worked and and can we identify the changes that introduced this behaviour? Or maybe the way how JavaScript is configured in WebView misses something?

FridoDeluxe commented 4 years ago

The problem with "Uncaught ReferenceError: NativeInterface is not defined" is just an log info in the WebView console. It should not be the cause for the missing map.

But I could find out a bit more: NativeInterface was introduced with 9baefb99b1d55b9bfd93a6cd5844fafe44e88058 to remember the map position and zoom level. It was (probably accidentially?) removed from MapActivity.java by 34ff6a74a767f20071ee88e5803c0df0554f6fcb.

FridoDeluxe commented 4 years ago

There should be no limit reached for the OWM weather overlays. I could directly request the overlay images in a desktop browser for all four layers without problems using Forecastie's API key.

robinpaulson commented 4 years ago

Golly, we didn't notice for six months....

FridoDeluxe commented 4 years ago

I noticed that all map layers did not use https URLs yet, so I changed them to https and that made all map layers visible for me again (Android 10). It still isn't clear to me why I could see the OpenStreetMap background before, but not the OpenWeatherMap overlays.

Can anyone else test and confirm that the maps show up again with #543 applied?

robinpaulson commented 4 years ago

OK, new release out, looks like it's fixed. Please report if there are any issues,

Korb commented 2 years ago

OSM map tiles show up, but no OWM overlays. This is the log output:

Same. Forecastie v1.22.1, Blackview BV8000 Pro (Android 7.0). Do I need to create a separate issue?

FridoDeluxe commented 2 years ago

Just tested: It's working for me with Forecastie 1.22.1 from F-Droid running on Android 11.

@Korb Are you sure the OWM overlays are not working? They are very blurry and low resolution, sometimes you need to zoom out to see any noticeable weather on the map. In case it's really broken for you, could you please provide error messages or log output?

Korb commented 2 years ago

@FridoDeluxe, see screenshots. No error messages appear. I don't know how to get the log output.

FridoDeluxe commented 2 years ago

@Korb Everything is fine, it is working for you. On the first of your screenshots you can see white clouds over the Neva Bay, on the fourth map you can see the orange color due to the temperature overlay (almost getting red in the hotter regions in the south).

Unfortunately the weather overlays from OWM have a quite low resolution and are mostly transparent, that's why they are not very noticeable (and not that useful in my eyes). If you zoom out a bit, you should see differences in the overlays in most cases. There are already issues mentioning the low contrast of the weather overlay (#563) and the missing scale/legend (#155).