1. #1
    Sencha User
    Join Date
    Sep 2010
    Location
    Coimbatore
    Posts
    16
    Vote Rating
    0
    gmanraj is on a distinguished road

      0  

    Default Ext.util.GeoLocation is not working

    Ext.util.GeoLocation is not working


    I have just tried the following code to update the current location. But it is not working, locationupdate and locationerror are never called. Please help me, I have to find the current location when ever i need it (by tap a button). If any one have idea about getting the current location other then this way, please post it.

    Code:
    var geo = new Ext.util.GeoLocation({
        autoUpdate: false,
        listeners: {
            locationupdate: function (geo) {
                alert('New latitude: ' + geo.latitude);
            },
            locationerror: function (   geo,
                                        bTimeout, 
                                        bPermissionDenied, 
                                        bLocationUnavailable, 
                                        message) {
                if(bTimeout){
                    alert('Timeout occurred.');
                }
                else{
                    alert('Error occurred.');
                }
            }
        }
    });
    geo.updateLocation();
    Thanks.

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,655
    Vote Rating
    583
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    I think it might just be your environment, popped up the new latitude straight away for me. Make sure your browser allows access.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    Sep 2010
    Location
    Coimbatore
    Posts
    16
    Vote Rating
    0
    gmanraj is on a distinguished road

      0  

    Default


    It works very well. I am very sorry, this is my bad. Thank you a lot.

  4. #4
    Ext User
    Join Date
    Sep 2010
    Posts
    73
    Vote Rating
    0
    lukesayaw is on a distinguished road

      0  

    Default


    Hi,

    I ve got the same problem. By the way, how do I give access to a web browser?

    Please help!

  5. #5
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,655
    Vote Rating
    583
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    In Chrome:
    Tools -> Options -> Under the Bonnet -> Content Settings -> Location
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  6. #6
    Ext User
    Join Date
    Sep 2010
    Posts
    73
    Vote Rating
    0
    lukesayaw is on a distinguished road

      0  

    Default


    thanks a lot!

  7. #7
    Ext User
    Join Date
    Sep 2010
    Posts
    73
    Vote Rating
    0
    lukesayaw is on a distinguished road

      0  

    Default


    Hi,

    it works fine in Chrome. however, i wonder how do i do the same thing in Safari. I havent got a clue about doing it in a safari.

    Many thanks,

  8. #8
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,655
    Vote Rating
    583
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  9. #9
    Ext User
    Join Date
    Sep 2010
    Posts
    73
    Vote Rating
    0
    lukesayaw is on a distinguished road

      0  

    Default


    thanks a lot for your help!

  10. #10
    Ext User
    Join Date
    Sep 2010
    Posts
    73
    Vote Rating
    0
    lukesayaw is on a distinguished road

      0  

    Default


    Hi,

    May I ask you one more thing? Currently I am working on a small project for mobile devices in sencha touch. One of the features of the project is to get a local information of a device on a google map and supply the device user with some local information like hotels, motels and their addresses respectively. I am aware that I could accomplish this feature in sencha touch using a powerful class/functionality like Ext.util.GeoLocation().

    However, I am very anxious to know if I could get some relevant local information(as mentioned above) of a device in sencha touch or do I need to use google's geocoding service supplying it with the latitude and longitude information in a url along with a marker etc. and get the information back from the goecoding in json format.

    Please guide me in the right direction.

    Thanks

Similar Threads

  1. Geolocation working on Android? Timeline on release for camera access
    By olin in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 10 Aug 2010, 12:32 AM
  2. Ext.util.GeoLocation tweeking
    By crp_spaeth in forum Sencha Touch 1.x: Discussion
    Replies: 3
    Last Post: 17 Jun 2010, 5:23 AM
  3. Ext.util.JSON.encode not working in IE....
    By ajax&me in forum Ext 2.x: Help & Discussion
    Replies: 11
    Last Post: 2 Jun 2008, 7:18 AM
  4. Ext.util.CSS.updaterule not working in IE
    By zipi in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 17 Jan 2008, 4:12 AM
  5. Replies: 2
    Last Post: 6 Mar 2007, 12:33 PM

Thread Participants: 2

Tags for this Thread