Using Google Weather API with Lat and Lon - how to format?

后端 未结 4 709
星月不相逢
星月不相逢 2020-12-17 02:45

I want to use the Google Weather API - by passing lat and long values. I am storing these values, however it seems Google needs these values in different format.

i.e

4条回答
  •  借酒劲吻你
    2020-12-17 03:45

    As Miguel said it is the last 6 digits that should be the decimal places. So the correct code is as simple as....

    string.Format("http://www.google.com/ig/api?weather=,,,{0:0},{1:0}", 
        (latitude * 1000000), 
        (longitude * 1000000));
    

提交回复
热议问题