Plugin

Archived
Forum
(read-only)

Google Weather

ExpressionEngine 1.x, ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Marcel Villerius

     

Latitude/Longitude is possible

General

JCDerrick
JCDerrick

This is just an FYI for anyone looking to use this add-on using lat and long. I think I found a way to do it.

You can parse the lat/long using this format:

location=",,,20715041,-156249704" 

My actual lat and long were:
20.715041 and -156.2449704

See this article for more information:
http://stackoverflow.com/questions/2780836/using-google-weather-api-with-lat-and-lon-how-to-format

Now I just have to figure out how to strip the “.” from the lat and long produced by my other add-on.

marcel
# 1
Developer
marcel

Hi JC,

That’s a nice suggestion! Thanks to the stackoverflow article I think I can add it to the extra. I’ll let you know when it is added.

Regards,

Marcel

JCDerrick
# 2
JCDerrick

That’d be great Marcel. Especially if you could find a way to do it where we could leave the “.” in the lat/long. I’ve found it’s hard to remove that without using the find/replace add-on. Thanks for your work on this.

Davor
# 3
Davor

+1
this would be nice!

marcel
# 4
Developer
marcel

Hi,

I’ve done several tests with latitude an longitude data but the Google Weather API does not appear to be consistent with the data. There is no logic to discover what the API does accept or not.

I added the functionality in version 1.06 and 2.06 without any warranty, so it can be tested. You can use it with decimal data, like this:

{exp:google_weather language=“nl” latitude=“44.06193297865348” longitude=”-121.27584457397461”}
  {current_icon}
{/exp:google_weather}

Latitude and longitude will override ‘location’.

JCDerrick
# 5
JCDerrick

Thanks again Marcel, I’ll give this a try and see how it works. The weird part about the Google API was the fact it had to be like 7-8 characters long (without the decimal). It was indeed quite strange.

marcel
# 6
Developer
marcel

I reposted the original plugin on Devot-ee, because the version with Latitude/Longitude wasn’t working as it should. The modified version is still available on the plugin webpage.
I’ll will work on it after my vacation. Any suggestions are always welcome.