Page 443 of 615 FirstFirst ... 343393433441442443444445453493543 ... LastLast
Results 8,841 to 8,860 of 12287

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: UniAW7

  1. #8841
    Quote Originally Posted by <Ian Nicoll/> View Post
    I think this is the final code I will use, but for my area it's not very accurate it only shows main city name, I cannot get the neighbourhood (village) names to show, need more investigating for a better API, but I guess this is better than "TBD".

    In main.js add this to top of dealWithWeather function:
    Code:
    	// Use Google for City Name only if Yahoo API is down
    	if (obj.city == "TBD") {
    		document.getElementById("city").style.display = 'none';
    		document.getElementById("address").style.display = 'none';
    				
    		var googleURL = "http://maps.googleapis.com/maps/api/geocode/xml?latlng=" + obj.latitude  + "," + obj.longitude + "&sensor=false";
    		jQuery.get(googleURL, function(data) {
    			obj.add = [];
    			var t=0;
    			$(data).find('result').each( function() {
    				obj.add[t] = $(this).find('formatted_address').text();
    				t++;
    			});
    		Gaddress = obj.add[0].split(",")[0].replace(/Pike/g,"Pk").replace(/Road/g,"Rd");
    		Gcity = obj.add[0].split(",")[1].replace(/Pike/g,"Pk").replace(/Road/g,"Rd");
    		if (ShowAddress == true) {
    			document.getElementById("googleAddress").innerHTML = Gaddress;
    		}
    		document.getElementById("googleCity").innerHTML = Gcity;
    		});
    	}


    In style.css, duplicate #city AND #address, re-name the duplicates to #googleCity AND #googleAddress (case sensitive).

    In all html files add these div's inside the WeatherContainer div: <div id="googleCity"></div> AND <div id="googleAddress"></div>

    This uses the coordinates from the WW2 xml file so no need to turn on the MyLocation option.
    If Yahoo API starts working again this code will not run, it will automatically revert to the "normal" way.
    okay so i've tried this and it works for address but for city/neighborhood/default option in widget options i get my postal code not the actual name of a city,but yes much better than TBD TY
    p.s. i tried with your modders base widget
    Last edited by #m37h{; 2016-01-22 at 04:38 PM.

  2. #8842
    Ian, so the code in post 8840 is what we need to get rid of the TBD, correct? We don't need Marty's code also? Just trying to clarify before editing.

  3. #8843
    Gary...your code worked great for my LS and SB.

    Thank you

  4. The Following 2 Users Say Thank You to bliken For This Useful Post:

    King_O_Hill (2016-01-22), Marty McFly (2016-01-22)

  5. #8844
    Quote Originally Posted by #m37h{ View Post
    okay so i've tried this and it works for address but for city/neighborhood/default option in widget options i get my postal code not the actual name of a city,but yes much better than TBD TY
    p.s. i tried with your modders base widget
    I wonder why you are getting postal code?? I will re-check all tomorrow. Mine works fine except it shows the City not the neighbourhood.
    Last edited by <Ian Nicoll/>; 2016-01-22 at 05:06 PM.

  6. The Following User Says Thank You to <Ian Nicoll/> For This Useful Post:

    #m37h{ (2016-01-22)

  7. #8845
    Quote Originally Posted by Mike2130 View Post
    Ian, so the code in post 8840 is what we need to get rid of the TBD, correct? We don't need Marty's code also? Just trying to clarify before editing.
    You can use mine or Marty's, both will work but with Marty's you need the MyLocation option on in WW2 settings. And if you use Marty's, don't copy his css parts, instead just duplicate the #city & #address settings then re-name them so the duplicates have the exact same settings i.e height, width, top etc etc..
    Note Marty's css names a different from mine.
    Last edited by <Ian Nicoll/>; 2016-01-22 at 05:04 PM.

  8. The Following 2 Users Say Thank You to <Ian Nicoll/> For This Useful Post:

    King_O_Hill (2016-01-22), Mike2130 (2016-01-22)

  9. #8846
    Quote Originally Posted by ;7347419
    Sorry, I forgot to disable these options when using Google, tomorrow. Mine is set to Neighbourhood & works fine except it shows the City not the neighbourhood.

    Same with mine....I have neighborhood selected but it is showing city.

    It is way better than he TBD.

    Just reporting

  10. The Following User Says Thank You to bliken For This Useful Post:

    King_O_Hill (2016-01-22)

  11. #8847
    Code Dependent NewD's Avatar
    Join Date
    Jan 2012
    Location
    Northeast US
    Posts
    5,733
    Thanks
    8,351
    Thanked 16,485 Times in 7,705 Posts

    Ian,
    The Google API is the most complete feed available today. Even better than the Yahoo one that went down. It has neighborhood and many other political boundaries. I posted the code for how to get after them a few posts back, but Marty was thinking, that since it wasn't a tutorial it might just confuse people - so deleted my post. I'm happy to PM the code to you if you'd like. Marty has it too. I entered your coordinates and got Maasin as neighborhood I think.. None of the feeds give us Guadaloupe for you. . But Google DOES have neighborhood.

    Google is definitely our alternative going forward. Best location API out there. Amazingly full for a free API where you don't need any 'keys'.

  12. The Following 2 Users Say Thank You to NewD For This Useful Post:

    bliken (2016-01-22), King_O_Hill (2016-01-22)

  13. #8848
    Quote Originally Posted by <Ian Nicoll/> View Post
    Sorry, I forgot to disable these options when using Google, tomorrow. Mine is set to Neighbourhood & works fine except it shows the City not the neighbourhood.
    no worries mate,thank you for this
    as you said much better than TBD

  14. #8849
    Quote Originally Posted by NewD View Post
    Ian,
    The Google API is the most complete feed available today. Even better than the Yahoo one that went down. It has neighborhood and many other political boundaries. I posted the code for how to get after them a few posts back, but Marty was thinking, that since it wasn't a tutorial it might just confuse people - so deleted my post. I'm happy to PM the code to you if you'd like. Marty has it too. I entered your coordinates and got Maasin as neighborhood I think.. None of the feeds give us Guadaloupe for you. . But Google DOES have neighborhood.

    Google is definitely our alternative going forward. Best location API out there. Amazingly full for a free API where you don't need any 'keys'.
    Maasin is my main city, it stretches about 20 kilometres & must have at minimum over 20 neighbourhoods in it, maybe you get neighbourhood in your area but not for me in the Philippines.

    If you know how to show neighbourhood please post it here.
    Last edited by <Ian Nicoll/>; 2016-01-22 at 05:12 PM.

  15. The Following 3 Users Say Thank You to <Ian Nicoll/> For This Useful Post:

    #m37h{ (2016-01-22), King_O_Hill (2016-01-22), NewD (2016-01-22)

  16. #8850
    Quote Originally Posted by #m37h{ View Post
    no worries mate,thank you for this
    as you said much better than TBD

    Check all again pal, Bilken has city showing, no idea why you would have postal code, can you pass your coordinates to me so I can check?

  17. The Following 2 Users Say Thank You to <Ian Nicoll/> For This Useful Post:

    #m37h{ (2016-01-22), King_O_Hill (2016-01-22)

  18. #8851

  19. #8852

  20. The Following User Says Thank You to bliken For This Useful Post:

    #m37h{ (2016-01-22)

  21. #8853
    Quote Originally Posted by <Ian Nicoll/> View Post
    Check all again pal, Bilken has city showing, no idea why you would have postal code, can you pass your coordinates to me so I can check?
    oops there is another problem:i get postal code as a part of address and no city showing,my guess is that i've everything right because i got the address,here is my coordinates
    from WW2 settings
    lat:45.811997
    lon:16.102735
    postal is 10360
    but in xml my postal code is blank like all location info
    Last edited by #m37h{; 2016-01-22 at 05:23 PM.

  22. The Following User Says Thank You to #m37h{ For This Useful Post:

    King_O_Hill (2016-01-22)

  23. #8854
    My iPhone is a Part of Me signori's Avatar
    Join Date
    Oct 2007
    Location
    Toronto
    Posts
    918
    Thanks
    689
    Thanked 758 Times in 397 Posts

    Thanks Marty, Ian and New for getting the widgets to show the city and address again. I need a little help if you have time of course. I want to have my address , city after it. Example: 10 Evans ave, Toronto I can't seem to figure out what code to put in the main.js file. It worked before yahoo went down. Thanks.

  24. The Following 2 Users Say Thank You to signori For This Useful Post:

    King_O_Hill (2016-01-22), Marty McFly (2016-01-22)

  25. #8855
    Here's mine: I don't switch on the address as it just says "Unknown Rd."

    Attached Thumbnails Attached Thumbnails -img_0314.png  

  26. The Following 2 Users Say Thank You to <Ian Nicoll/> For This Useful Post:

    King_O_Hill (2016-01-22), signori (2016-01-22)

  27. #8856
    Default UniAW7
    Whenever I make changes to main. Js, just one chat. .. It breaks widget. Any way around this? Uniaw7.1?? It's very frustrating
    Last edited by laMe; 2016-01-22 at 05:23 PM.

  28. #8857
    Quote Originally Posted by laMe View Post
    Whenever I make changes to main. Js.. It breaks widget. Any way around this?
    Did you read #2 on post #8821?

    You need to check the picture at bottom of thread. I had to make a change.

    Check the picture with what you put in the main.js.

    Line by line. Make sure hey are identical

  29. The Following User Says Thank You to bliken For This Useful Post:

    Marty McFly (2016-01-22)

  30. #8858
    Quote Originally Posted by signori View Post
    Thanks Marty, Ian and New for getting the widgets to show the city and address again. I need a little help if you have time of course. I want to have my address , city after it. Example: 10 Evans ave, Toronto I can't seem to figure out what code to put in the main.js file. It worked before yahoo went down. Thanks.
    Sorry Signori I really must sleep now but to make life easy for helpers if any of you have an issue please state if you are using mine of Marty's code & in order for us to check it's better we get your coordinates from either the MyLocation.txt file or from the widgetweather.xml file (look for latitude & longitude).

    Sorry again.

    Gnight.

  31. The Following 4 Users Say Thank You to <Ian Nicoll/> For This Useful Post:

    King_O_Hill (2016-01-22), Marty McFly (2016-01-22), NewD (2016-01-22), signori (2016-01-22)

  32. #8859
    Quote Originally Posted by laMe View Post
    Whenever I make changes to main. Js, just one chat. .. It breaks widget. Any way around this? Uniaw7.1?? It's very frustrating
    don't make changes with ifile,
    try with filza or PC or Mac

  33. The Following User Says Thank You to #m37h{ For This Useful Post:

    laMe (2016-01-22)

  34. #8860
    Default UniAW7
    Thank you guys!!! Working!

    -imageuploadedbymodmyi1453480569.060522.jpg
    Last edited by laMe; 2016-01-22 at 05:36 PM.

  35. The Following User Says Thank You to laMe For This Useful Post:

    #m37h{ (2016-01-22)

Page 443 of 615 FirstFirst ... 343393433441442443444445453493543 ... LastLast
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •