Page 445 of 613 FirstFirst ... 345395435443444445446447455495545 ... LastLast
Results 8,881 to 8,900 of 12259

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


Thread: UniAW7

  1. #8881
    Quote Originally Posted by Marty McFly View Post
    You can't make it work with any widget? Post one up and I'll be happy to take a look.


    EDIT: Updated tutorial code again so "undefined" does not display if the fields in the Google feed happen to be blank.


    So the original has been updated? I will have to check when I get back home.

    Hopefully it will fix the neighborhood showing as undefined.

  2. #8882
    Quote Originally Posted by laMe View Post
    I'm in the eye of the storm. Blizzard in like an hour. Oh joy. Lol
    I'm right there with ya.

  3. The Following User Says Thank You to Glawrence33 For This Useful Post:

    laMe (2016-01-22)

  4. #8883
    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.

    In the .js you don't need the ".replace(/Pike/g,"Pk").replace(/Road/g,"Rd")" for Gcity but I left it in anyway.
    You could change this line:
    Gcity = obj.add[0].split(",")[1].replace(/Pike/g,"Pk").replace(/Road/g,"Rd");
    To this:
    Gcity = obj.add[0].split(",")[1];

    I followed this... and double checked..

    still showing TBD

  5. #8884
    and on another widget.. I show nothing at all for city not even TBD

  6. #8885
    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

    Quote Originally Posted by Marty McFly View Post
    Yes and yes

    Province I will show you later (if Grant doesn't get to it first). For the Durham thing, in main.js change this line...

    document.getElementById("Gcounty").innerHTML = county;

    to this...

    document.getElementById("Gcounty").innerHTML = county.substr(0,county.indexOf(' '));
    Thanks. Also Thanks again to NewD, Ian and you of course for keeping these widgets running 100%.

  7. #8886
    Quote Originally Posted by VOLTAGExDT View Post
    and on another widget.. I show nothing at all for city not even TBD
    Hey V man! Sorry it's not working for you. Maybe try this method to see if you get different results...

    http://modmyi.com/forums/iphone-6-th...ml#post7347243

  8. The Following User Says Thank You to Marty McFly For This Useful Post:

    VOLTAGExDT (2016-01-23)

  9. #8887
    Default UniAW7
    Hey guys I'm not a professional but I notice this iWidget has been working 100% all day! Try to download & see why it's the only one working. Just putting my 2 cents..🏻-imageuploadedbymodmyi1453504236.211749.jpg-imageuploadedbymodmyi1453504244.528801.jpg-imageuploadedbymodmyi1453504711.000927.jpg
    Last edited by mike42; 2016-01-23 at 12:18 AM.

  10. #8888
    Quote Originally Posted by Marty McFly View Post
    OK folks, Google tutorial post updated. I highly recommend reading it again as the info is now coming from a more reliable place in the feed. Less likely to give you erros. Grant pointed this out to me and he is right! Also, just to be clear, I did not write any of the code for this location info work-around. Grant gave me his "ultimate location iwidget" (or whatever it's called) and I used that as base. He should be the one thanked for this, not me.

    So the tutorial now also shows how to get city, address, neighborhood and county. Of course, only if these things are available in the feed for your area. I recommend looking at the tutorial on a PC instead of a phone as there are some colour coded instructions and I'm not sure about everyone else but I don't see the colours when viewing on my phone.

    Here is a link to the updated tutorial. Good luck!

    http://modmyi.com/forums/iphone-6-th...ml#post7347243


    Edit: OK, here you go! Much easier to see all this code in action with a widget. This is the one I've been using...

    Attachment 721096

    All location info from Google.

    Download link: TimeCircuits WW2 with Google
    Sorry at the moment I understand nothing more, where I have to pack clean the file and where can I find the path WW2

  11. #8889
    No neighbourhood given for my area, looks like Google is not the answer for all folks.

    http://maps.googleapis.com/maps/api/...0&sensor=false

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

    jm26200 (2016-01-23), Marty McFly (2016-01-23)

  13. #8890
    Quote Originally Posted by Marty McFly View Post
    Hey V man! Sorry it's not working for you. Maybe try this method to see if you get different results...

    http://modmyi.com/forums/iphone-6-th...ml#post7347243
    broked widget..
    nothing at all shows I mean blank screen
    I think its main..
    I saw pic but saw no difference in your posted code vs image.

    now to make sure im doing this correct in main im

    replacing

    function dealWithWeather(obj) {

    with your code

    or

    should I be doing something else..

    because in your code you have
    function dealWithWeather(obj) {

    so I highlighted it and copied this right over it

    function dealWithWeather(obj) {

    var url2 = "file:///private/var/mobile/Documents/myLocation" + ".txt";
    jQuery.get(url2, function(appdata){
    var substr = appdata.split('\n'):
    var templatitude=substr[0].split('=');
    var templongitude=substr[1].split('=');
    var latitude = $.trim(templatitude[1]);
    var longitude = $.trim(templongitude[1]);
    obj.coords = latitude + "," + longitude;

    var Gurl = "http://maps.googleapis.com/maps/api/geocode/xml?latlng=" + obj.coords + "&sensor=false";
    jQuery.get(Gurl, function(data) {
    obj.type = [];
    obj.longname = [];

    var s=0;
    $(data).find('address_component').each( function() {
    obj.longname[s] = $(this).find('long_name').text();
    obj.type[s] = $(this).find('type').text();
    s++;

    });

    for (i=0; i < obj.type.length; i++) {
    if (obj.type[i].indexOf('street_number') != -1) { var stnumber = obj.longname[i]; break; } else{ var stnumber = " "}}

    for (i=0; i < obj.type.length; i++) {
    if (obj.type[i].indexOf('route') != -1) { var address = obj.longname[i]; break; }else{ var address = " "} }

    for (i=0; i < obj.type.length; i++) {
    if ((obj.type[i].match('locality') ) && (!obj.type[i].match('sublocality') )) { var city = obj.longname[i]; break; }else{ var city = " "} }

    for (i=0; i < obj.type.length; i++) {
    if (obj.type[i].indexOf('administrative_area_level_2') > -1) { var county = obj.longname[i]; break; } }

    for (i=0; i < obj.type.length; i++) {
    if (obj.type[i].indexOf('administrative_area_level_3') > -1) { var neighborhood = obj.longname[i]; break; } }

    document.getElementById("Gaddress").innerHTML = stnumber + " " + address;
    document.getElementById("Gcity").innerHTML = city;
    document.getElementById("Gneighborhood").innerHTML = neighborhood;
    document.getElementById("Gcounty").innerHTML = county;

    });

    });

  14. #8891
    Quote Originally Posted by VOLTAGExDT View Post
    broked widget..
    nothing at all shows I mean blank screen
    I think its main..
    I saw pic but saw no difference in your posted code vs image.

    now to make sure im doing this correct in main im

    replacing

    function dealWithWeather(obj) {

    with your code

    or

    should I be doing something else..

    because in your code you have
    function dealWithWeather(obj) {

    so I highlighted it and copied this right over it


    Hey I did that too and it didn't copy the ') after the n in the third line from top

    Check that

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

    Marty McFly (2016-01-23)

  16. #8892
    V man - just copy the red code. The "function dealWithWeather(obj) {" line is just there to show you where to put it. You should have that in your existing widget. Don't remove/replace that. Just copy code in red directly under it.

  17. #8893
    Code Dependent NewD's Avatar
    Join Date
    Jan 2012
    Location
    Northeast US
    Posts
    5,708
    Thanks
    8,334
    Thanked 16,463 Times in 7,695 Posts

    Gang,
    For everyone's sake.. I'll try to be brief. Promise.

    The way Google works, what we've been calling "neighborhood" for several years can be different things in different places in the world. BUT.. all types of 'neighborhoods' (townships, regional district municipalities, division, regions, districts, and actual neighborhoods within medium to large cities) are reported as one of three things in the Google field:
    1) 'neighborhood'
    2) 'administrative_area_level_3'
    3) 'sublocality'

    In my two years of working with this feed. I've seen no other distinction.

    Marty has given us the 'administrative_area_level_3' one in his code above. That one will get the 14 states in the US that have townships their township. And some unique features in Canada. Probably nothing in most of Europe and Asia.

    SO.... I will add a few lines to the code.. that will search for ALL 3 possibilities and which ever of the '3' comes up THAT one will show in NEIGHBORHOOD for you. Which will most closely mimic what Yahoo was doing.. But even better in my opinion. More possible data.

    So keep things SIMPLE.. If data exists in MORE than one of the three fields I will have it show after a '/' so you'll see both or all 3 (rare). Then you can manipulate the code to see only 1.

    So it's MARTY'S CODE I will manipulate. Ian.. may still want us to be able to choose NEIGHBORHOOD over CITY.. in the CITY field.. So stay tuned for his code as a choice too...

    Hang on.. I'll post when I finish coding it.

  18. The Following 3 Users Say Thank You to NewD For This Useful Post:

    A11AST3R (2016-01-23), bliken (2016-01-23), nik1975 (2016-01-23)

  19. #8894

  20. #8895
    Quote Originally Posted by Marty McFly View Post
    V man - just copy the red code. The "function dealWithWeather(obj) {" line is just there to show you where to put it. You should have that in your existing widget. Don't remove/replace that. Just copy code in red directly under it.

    ok but then that's what I did

    the code I posted above is the whole code I inserted..
    and it was the only dealwith weather

    basically I highlighted that snipped of code..
    and hit paste.. so it overwrote that code and added the same line and then the following..

    here.....



    return tmpDate + "rd";
    break;
    default:
    return tmpDate + "th";
    break;
    }
    }

    function dealWithWeather(obj) {

    var url2 = "file:///private/var/mobile/Documents/myLocation" + ".txt";
    jQuery.get(url2, function(appdata){
    var substr = appdata.split('\n
    var templatitude=substr[0].split('=');
    var templongitude=substr[1].split('=');
    var latitude = $.trim(templatitude[1]);
    var longitude = $.trim(templongitude[1]);
    obj.coords = latitude + "," + longitude;

    var Gurl = "http://maps.googleapis.com/maps/api/geocode/xml?latlng=" + obj.coords + "&sensor=false";
    jQuery.get(Gurl, function(data) {
    obj.type = [];
    obj.longname = [];

    var s=0;
    $(data).find('address_component').each( function() {
    obj.longname[s] = $(this).find('long_name').text();
    obj.type[s] = $(this).find('type').text();
    s++;

    });

    for (i=0; i < obj.type.length; i++) {
    if (obj.type[i].indexOf('street_number') != -1) { var stnumber = obj.longname[i]; break; } else{ var stnumber = " "}}

    for (i=0; i < obj.type.length; i++) {
    if (obj.type[i].indexOf('route') != -1) { var address = obj.longname[i]; break; }else{ var address = " "} }

    for (i=0; i < obj.type.length; i++) {
    if ((obj.type[i].match('locality') ) && (!obj.type[i].match('sublocality') )) { var city = obj.longname[i]; break; }else{ var city = " "} }

    for (i=0; i < obj.type.length; i++) {
    if (obj.type[i].indexOf('administrative_area_level_2') > -1) { var county = obj.longname[i]; break; } }

    for (i=0; i < obj.type.length; i++) {
    if (obj.type[i].indexOf('administrative_area_level_3') > -1) { var neighborhood = obj.longname[i]; break; } }

    document.getElementById("Gaddress").innerHTML = stnumber + " " + address;
    document.getElementById("Gcity").innerHTML = city;
    document.getElementById("Gneighborhood").innerHTML = neighborhood;
    document.getElementById("Gcounty").innerHTML = county;

    });

    });

    // INITIALIZE ANIMATION SWITCH (HERE TO BE SURE THE FUNCTION WILL BE LAUNCHED ONLY IF WE HAVE SOME WEATHER INFOMATIONS)
    if (dayhour == null) { StartAnimationTouch(); }

  21. The Following User Says Thank You to VOLTAGExDT For This Useful Post:

    Marty McFly (2016-01-23)

  22. #8896
    Quote Originally Posted by bliken View Post
    Hey I did that too and it didn't copy the ') after the n in the third line from top

    Check that
    Yes absolutely. Check that too V. Thanks Blik. Look at the picture at the bottom of the instruction post V and make sure it looks exactly the same. Specifically, the "var substr" and "var templatitude" lines near the top. Those are the ones not displaying properly in the post. Unfortunately just copying and pasting won't work. Need to fix those two lines manually.

  23. The Following 2 Users Say Thank You to Marty McFly For This Useful Post:

    King_O_Hill (2016-01-23), VOLTAGExDT (2016-01-23)

  24. #8897
    Quote Originally Posted by Marty McFly View Post
    Hey V man! Sorry it's not working for you. Maybe try this method to see if you get different results...

    http://modmyi.com/forums/iphone-6-th...ml#post7347243

    ha ya I did : instead of ; on the missing line..

    so thank you that fixed it

  25. The Following User Says Thank You to VOLTAGExDT For This Useful Post:

    Marty McFly (2016-01-23)

  26. #8898
    AddToMain.js.txt

    here marty may help the instruction post

  27. The Following User Says Thank You to VOLTAGExDT For This Useful Post:

    King_O_Hill (2016-01-23)

  28. #8899

  29. The Following 3 Users Say Thank You to Marty McFly For This Useful Post:

    <Ian Nicoll/> (2016-01-23), King_O_Hill (2016-01-23), kristatos (2016-01-26)

  30. #8900
    Default UniAW7
    Quote Originally Posted by VOLTAGExDT View Post
    ok but then that's what I did

    the code I posted above is the whole code I inserted..
    and it was the only dealwith weather

    basically I highlighted that snipped of code..
    and hit paste.. so it overwrote that code and added the same line and then the following..

    here.....
    Don't edit code with ifile, use an html editor on your PC.


    I've noticed with Yahoo that my street address would change slightly due to my ww2 GPS settings. Does anyone know why Google just has same street address( which is close but not real close?) it won't change at all

    -imageuploadedbymodmyi1453512083.533335.jpg
    Last edited by laMe; 2016-01-23 at 02:21 AM.

Page 445 of 613 FirstFirst ... 345395435443444445446447455495545 ... 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
  •