[Overlay] Google Weather Icon Overlay

Started by brotbuexe, August 01, 2013, 17:07:18

0 Members and 1 Guest are viewing this topic.

brotbuexe

<?xml version="1.0" encoding="UTF-8"?>
<providers>
      <provider id="11704" type="0" visible="true" background="-1">
      <name>Overlays</name>
      <mode>Google Weather Icons</mode>
      <area></area>
      <url><![CDATA[http://mts{s}.google.com/mapslt?&x={x}&y={y}&z={z}&s=Galileo&lyrs=weather_c_kph|invert:1&w=256&h=256]]></url>
      <serverPart>0;1</serverPart>
      <zoomPart>{z}-8</zoomPart>
      <zoomMin>8</zoomMin>
      <zoomMax>20</zoomMax>
      <tileSize>256</tileSize>
      <attribution><![CDATA[(c)2011 Google - Map data (c)2011 Tele Atlas]]></attribution>
      <extraHeader><![CDATA[User-Agent#Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1]]></extraHeader>
      <extraHeader><![CDATA[Referer#http://maps.google.com/]]></extraHeader>
   </provider>
</providers>

[attachment=0:fjpf1grp]Screenshot_2013-08-01-17-05-47.png[/attachment:fjpf1grp]
  •  

brotbuexe

#1
This is fun.

<?xml version="1.0" encoding="UTF-8"?>
<providers>
   <provider id="11704" type="0" visible="true" background="-1">
      <name>Overlays</name>
      <mode>Google Weather Icons</mode>
      <area></area>
      <url><![CDATA[http://mts{s}.google.com/mapslt?&x={x}&y={y}&z={z}&s=Galileo&lyrs=weather_c_kph|invert:1&w=256&h=256]]></url>
      <serverPart>0;1</serverPart>
      <zoomPart>{z}-8</zoomPart>
      <zoomMin>8</zoomMin>
      <zoomMax>20</zoomMax>
      <tileSize>256</tileSize>
      <attribution><![CDATA[(c)2011 Google - Map data (c)2011 Tele Atlas]]></attribution>
      <extraHeader><![CDATA[User-Agent#Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1]]></extraHeader>
      <extraHeader><![CDATA[Referer#http://maps.google.com/]]></extraHeader>
   </provider>
   <provider id="11705" type="0" visible="true" background="-1">
      <name>Overlays</name>
      <mode>Google Weather Clouds</mode>
      <area></area>
      <url><![CDATA[http://mts{s}.google.com/vt/lyrs=weather_0cloud&hl=de&src=app&x={x}&y={y}&z={z}&s=Galile]]></url>
      <serverPart>0;1</serverPart>
      <zoomPart>{z}-8</zoomPart>
      <zoomMin>8</zoomMin>
      <zoomMax>15</zoomMax>
      <tileSize>256</tileSize>
      <attribution><![CDATA[(c)2011 Google - Map data (c)2011 Tele Atlas]]></attribution>
      <extraHeader><![CDATA[User-Agent#Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1]]></extraHeader>
      <extraHeader><![CDATA[Referer#http://maps.google.com/]]></extraHeader>
   </provider>
   <provider id="11706" type="0" visible="true" background="11705">
      <name>Overlays</name>
      <mode>Google Weather Icons and Clouds</mode>
      <area></area>
      <url><![CDATA[http://mts{s}.google.com/mapslt?&x={x}&y={y}&z={z}&s=Galileo&lyrs=weather_c_kph|invert:1&w=256&h=256]]></url>
      <serverPart>0;1</serverPart>
      <zoomPart>{z}-8</zoomPart>
      <zoomMin>8</zoomMin>
      <zoomMax>20</zoomMax>
      <tileSize>256</tileSize>
      <attribution><![CDATA[(c)2011 Google - Map data (c)2011 Tele Atlas]]></attribution>
      <extraHeader><![CDATA[User-Agent#Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1]]></extraHeader>
      <extraHeader><![CDATA[Referer#http://maps.google.com/]]></extraHeader>
   </provider>
</providers>

Don't understand the strange behaviour when using the cloud overlay mit SRC_ATOP mode. See screenshots.

[attachment=0:23t7l4l6]Screenshot_2013-08-01-17-18-16.png[/attachment:23t7l4l6]

What else does google maps have?
  •  

brotbuexe

#2
Looks like my combination of clouds and icons into one custom map does not work well with the overlay function.
When I use only the cloud layer it looks fine.
So you have to switch between icons and clouds.

Keep in mind, clouds only until zoom level 6. Icons only until 12.
  •  

brotbuexe

#3
[attachment=1:3hre3g7o]Screenshot_2013-08-01-17-57-52.jpg[/attachment:3hre3g7o]

[attachment=0:3hre3g7o]Screenshot_2013-08-01-17-57-24.jpg[/attachment:3hre3g7o]
  •  

ta-ka

#4
Hi, brotbuexe. Thank you for the information. After some trial and error,
I've successfully managed to overlay both clouds and weather icons onto map.



EDIT:
The code here was wrong. So deleted. Corrected code can be found below.
  •  

jusc

I see the pictures, but what is to do? With your extract of the providers.xml I only get the weather icons, but no clouds.  :'(
Regards J.
  •  

john_percy

Me too. No clouds with this xml file, I'm afraid.

The good news is that the latest version of Locus works with the overlays at all zooms. So the clouds are zoom with the map (fine) and the  icons similarly (not so fine, but useful)

Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  

ta-ka

Hmm...may be this? I can see clouds up to zoom level 6, too.

Quote from: brotbuexe on August 01, 2013, 17:23:38
Keep in mind, clouds only until zoom level 6. Icons only until 12.
  •  

ta-ka

#8
Please change zoomMax to '14' and try again. Sorry for that.
I confirmed that both clouds and icons are shown with scaled size above zoom level 7.
It worked with Locus test version 2.14.1.11 on Galaxy Note 2. But it didn't work with Locus Pro 2.15.1.
EDIT:
Enabling [Automatic Zoom-lock] in [Settings]->[Map - control & panels], clouds and icons are scaled
for both test and pro version.




<?xml version="1.0" encoding="UTF-8"?>
<providers>
    <provider id="11707" type="0" visible="true" background="-1">
        <name>Google Weather</name>
        <mode>Clouds and Weather Icons</mode>
        <url><![CDATA[http://mts{s}.google.com/vt/x={x}&y={y}&z={z}&lyrs=weather_c_kph|invert:0,weather_0cloud]]></url>
        <serverPart>0;1</serverPart>
        <zoomPart>{z}-8</zoomPart>
        <zoomMin>8</zoomMin>
        <zoomMax>14</zoomMax>
        <tileSize>256</tileSize>
        <attribution><![CDATA[(c)2011 Google - Map data (c)2011 Tele Atlas]]></attribution>
        <extraHeader><![CDATA[User-Agent#Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1]]></extraHeader>
        <extraHeader><![CDATA[Referer#http://maps.google.com/]]></extraHeader>
    </provider>
</providers>
  •  

jusc

Ah, ok. It works with zoom level 6 max.
Thank you for your hints. Above zoom level 6 the clouds disappear.
Regards J.
  •  

eldron

This looks very interesting. Before i try it out i was wondering how practical it is?
How do you get the map to refresh? Won´t Locus just cache the map and thereby prevent refreshing by unloading and loading the map?
How could i know how old the data is that i am looking at? I mean other than by comparing my thermometer with the temparature on the map ;-)

  •  

berkley

Click on the tools sign, before you choose your map and hit "Set 'valid for' "


Then you enter a zero in the popup. Now you always get the newest tiles.
Search before posting!!!
XDA Orbit, HTC Touch HD, SGS1, SGS2, Nexus S, S4 Active, OnePlus One, Innos D6000
OnePlus X
  •  

eldron

What a cool feature. Just tried it out and it looks great.
Thanks to you guys for showing us how to implement this!
The only problem is that the cloud layer is above the icon layer, making it very difficult to see the icons and temparature when there are clouds above that area. Is there any way of improving that? Maybe by changing the layers around so that the icon layer is above the cloud layer?
  •  

ta-ka

Quote from: eldron on September 12, 2013, 08:59:49
The only problem is that the cloud layer is above the icon layer, making it very difficult to see the icons and temparature when there are clouds above that area. Is there any way of improving that? Maybe by changing the layers around so that the icon layer is above the cloud layer?

There is an another way to overlay clouds and icons onto maps. This method doesn't use Map-Overlays function. Instead, the map with clouds and icons is simply treated as one of online map.  The icons can be clearly seen even over the clouds however the clouds are only visible up to zoom level 6.


<?xml version="1.0" encoding="UTF-8"?>
    <provider id="11708" type="0" visible="false" background="-1">
        <name>Google Weather</name>
        <mode>Satellite</mode>
        <url><![CDATA[http://mts{s}.google.com/vt/x={x}&y={y}&z={z}&lyrs=s,h@1,weather_nolabels]]></url>
        <serverPart>0;1</serverPart>
        <zoomPart>{z}-8</zoomPart>
        <zoomMin>8</zoomMin>
        <zoomMax>23</zoomMax>
        <tileSize>256</tileSize>
        <attribution><![CDATA[(c)2011 Google - Map data (c)2011 Tele Atlas]]></attribution>
        <extraHeader><![CDATA[User-Agent#Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1]]></extraHeader>
        <extraHeader><![CDATA[Referer#http://maps.google.com/]]></extraHeader>
    </provider>
    <provider id="11709" type="0" visible="false" background="11708">
        <name>Google Weather</name>
        <mode>Clouds on Satellite</mode>
        <url><![CDATA[http://mts{s}.google.com/vt/x={x}&y={y}&z={z}&lyrs=weather_0cloud]]></url>
        <serverPart>0;1</serverPart>
        <zoomPart>{z}-8</zoomPart>
        <zoomMin>8</zoomMin>
        <zoomMax>14</zoomMax>
        <tileSize>256</tileSize>
        <attribution><![CDATA[(c)2011 Google - Map data (c)2011 Tele Atlas]]></attribution>
        <extraHeader><![CDATA[User-Agent#Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1]]></extraHeader>
        <extraHeader><![CDATA[Referer#http://maps.google.com/]]></extraHeader>
    </provider>
    <provider id="11710" type="0" visible="true" background="11709">
        <name>Google Weather</name>
        <mode>Clouds and Weather Icons on Satellite</mode>
        <url><![CDATA[http://mts{s}.google.com/mapslt?x={x}&y={y}&z={z}&lyrs=weather_c_kph|invert:0]]></url>
        <serverPart>0;1</serverPart>
        <zoomPart>{z}-8</zoomPart>
        <zoomMin>8</zoomMin>
        <zoomMax>23</zoomMax>
        <tileSize>256</tileSize>
        <attribution><![CDATA[(c)2011 Google - Map data (c)2011 Tele Atlas]]></attribution>
        <extraHeader><![CDATA[User-Agent#Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1]]></extraHeader>
        <extraHeader><![CDATA[Referer#http://maps.google.com/]]></extraHeader>
    </provider>
</providers>

  •  

john_percy

#14
If you set the "Valid for" to zero for the above, then the satellite image has to be loaded every time, which won't help your bandwidth!
In the overlay version some posts previously, the icons enlarge ridiculously past zoom 6, so how about an overlay like this:
    <provider id="11711" type="0" visible="false" background="-1">
        <name>Overlays</name>
        <mode>Clouds</mode>
        <url><![CDATA[http://mts{s}.google.com/vt/x={x}&y={y}&z={z}&lyrs=weather_0cloud]]></url>
        <serverPart>0;1</serverPart>
        <zoomPart>{z}-8</zoomPart>
        <zoomMin>8</zoomMin>
        <zoomMax>14</zoomMax>
        <tileSize>256</tileSize>
        <attribution><![CDATA[(c)2011 Google - Map data (c)2011 Tele Atlas]]></attribution>
        <extraHeader><![CDATA[User-Agent#Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1]]></extraHeader>
        <extraHeader><![CDATA[Referer#http://maps.google.com/]]></extraHeader>
    </provider>
    <provider id="11712" type="0" visible="true" background="11711">
        <name>Overlays</name>
        <mode>Weather - Clouds and Icons</mode>
        <url><![CDATA[http://mts{s}.google.com/mapslt?x={x}&y={y}&z={z}&lyrs=weather_c_kph|invert:0]]></url>
        <serverPart>0;1</serverPart>
        <zoomPart>{z}-8</zoomPart>
        <zoomMin>8</zoomMin>
        <zoomMax>23</zoomMax>
        <tileSize>256</tileSize>
        <attribution><![CDATA[(c)2011 Google - Map data (c)2011 Tele Atlas]]></attribution>
        <extraHeader><![CDATA[User-Agent#Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1]]></extraHeader>
        <extraHeader><![CDATA[Referer#http://maps.google.com/]]></extraHeader>
    </provider>

Clouds only appear up to zoom 6, which seems the most usable arrangement, as they then do not obscure map detail when you want it.
The "Clouds" layer 11711 in my code above does not appear in the Locus menu, but is used to build the overlay.
PS It might be best to set "Valid for" to 1 hour in any case, as weather really doesn't change that quickly, even in England.
Voluntary and Velocity themes - https://voluntary.nichesite.org
  •