1. #1
    Ext User
    Join Date
    Nov 2010
    Posts
    24
    Vote Rating
    0
    NitrOuS is on a distinguished road

      0  

    Default Ext.Map with geolocation problem

    Ext.Map with geolocation problem


    What I want to do is to have a map to show the user's current location. And I have the following problem while testing as part whole application. When I want to show the map I can't get the user's location. Here is the code:

    PHP Code:
    var currentLocationMap = new Ext.Map({
        
    getLocationtrue,
        
    fullscreentrue
    });

    MyNameSpace.NearUserLocationMap = new Ext.Panel({
        
    items: [currentLocationMap]
    }); 
    While testing it in my chrome browser I don't even get the warning that the localhost wants to know my location.What am I doing wrong?

  2. #2
    Sencha User
    Join Date
    Sep 2010
    Location
    Netherlands
    Posts
    190
    Vote Rating
    0
    kevinv1990 is on a distinguished road

      0  

    Default


    Heey,

    here you go, put this in the JS file:

    Code:
    geo = new Ext.util.GeoLocation({
                accuracy: 1,
                autoUpdate: true,
                listeners: {
                    locationupdate: function (geo) {
                        currentLat = geo.latitude;
                        currentLng = geo.longitude;
                        currentLocation = new google.maps.LatLng(geo.latitude, geo.longitude);
                    },
                    locationerror: function (geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) {
                        if(bTimeout){
                            alert('Helaas kunnen we uw locatie niet bepalen');
                        }
                        else{
                            alert('Helaas kunnen we uw locatie niet bepalen');
                        }
                    }
                }
            });
            geo.updateLocation();

  3. #3
    Sencha User
    Join Date
    Sep 2010
    Location
    Netherlands
    Posts
    190
    Vote Rating
    0
    kevinv1990 is on a distinguished road

      0  

    Default


    Here you go:

    Code:
    geo = new Ext.util.GeoLocation({
                accuracy: 1,
                autoUpdate: true,
                listeners: {
                    locationupdate: function (geo) {
                        currentLat = geo.latitude;
                        currentLng = geo.longitude;
                        currentLocation = new google.maps.LatLng(geo.latitude, geo.longitude);
                    },
                    locationerror: function (geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) {
                        if(bTimeout){
                            alert('Helaas kunnen we uw locatie niet bepalen');
                        }
                        else{
                            alert('Helaas kunnen we uw locatie niet bepalen');
                        }
                    }
                }
            });
            geo.updateLocation();

  4. #4
    Sencha User
    Join Date
    Sep 2010
    Location
    Netherlands
    Posts
    190
    Vote Rating
    0
    kevinv1990 is on a distinguished road

      0  

    Default


    You can retrieve current location of the user by :

    Code:
    // Current location
            geo = new Ext.util.GeoLocation({
                accuracy: 1,
                autoUpdate: true,
                listeners: {
                    locationupdate: function (geo) {
                        currentLat = geo.latitude;
                        currentLng = geo.longitude;
                        currentLocation = new google.maps.LatLng(geo.latitude, geo.longitude);
                    },
                    locationerror: function (geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) {
                        if(bTimeout){
                            alert('Helaas kunnen we uw locatie niet bepalen');
                        }
                        else{
                            alert('Helaas kunnen we uw locatie niet bepalen');
                        }
                    }
                }
            });
            geo.updateLocation();
    currentLocation will be filled with the lat and lng and can be used for the position of a marker, or can be used to zoom the map on.

  5. #5
    Ext User
    Join Date
    Nov 2010
    Posts
    24
    Vote Rating
    0
    NitrOuS is on a distinguished road

      0  

    Default


    I have also tried to put the code from map example in my application and none worked. Any ideas?

  6. #6
    Ext User
    Join Date
    Nov 2010
    Posts
    24
    Vote Rating
    0
    NitrOuS is on a distinguished road

      0  

    Default


    @Kevin: Firstly I'd like to thank you for your answer. I tried to do what you said but I couldn't get it to work. I don't currently have the code snippet to show exactly what I'm doing, but I have one more clue. In neither desktop nor iPhone,where I'm currently testing my apps, I get the notice that the site wants to know where I am. Moreover as I said in a previous post I took the whole map example and put it on my project and I just changed the main Panel defining it as part of my application namespace and just didn't work, although the example itself worked fine. How is that possible? Do you have any idea? Thanks in advance for your time.

  7. #7
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Vote Rating
    21
    jep will become famous soon enough jep will become famous soon enough

      0  

    Default


    FYI, there are some bugs in Ext.Map that cause it to not work. See here:

    http://www.sencha.com/forum/showthre...invalid-option

    Here's a thread where I come up with an example of how to get it to work:
    http://www.sencha.com/forum/showthre...ocation-on-map

Similar Threads

  1. Ext.util.GeoLocation and .99
    By xnakxx in forum Sencha Touch 1.x: Discussion
    Replies: 9
    Last Post: 5 Nov 2010, 1:31 PM
  2. Google Map (Ext.Map) Info Window does not style??
    By directx0000 in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 19 Sep 2010, 7:19 PM
  3. [FIXED-207] Ext.Map: wrapped map unavailable in afterRender
    By cnelissen in forum Sencha Touch 1.x: Bugs
    Replies: 2
    Last Post: 8 Sep 2010, 7:05 PM
  4. Ext.util.GeoLocation tweeking
    By crp_spaeth in forum Sencha Touch 1.x: Discussion
    Replies: 3
    Last Post: 17 Jun 2010, 5:23 AM
  5. Problem with image map using Ext.DomHelper
    By raykov in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 15 Jul 2008, 5:52 AM

Thread Participants: 2

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."