1. #1
    Sencha User
    Join Date
    Feb 2013
    Posts
    4
    Vote Rating
    0
    aleshawebsight is on a distinguished road

      0  

    Default Unanswered: Ext.util.geolocation locationupdate() function not firing

    Unanswered: Ext.util.geolocation locationupdate() function not firing


    Ext version tested:
    · Ext 4.0.2

    Browser versions tested against:
    · Chrome 11 (Windows)
    · Safari

    Description:
    · Ext.Map – maprender() function in which Ext.util.geolocation has been used,locationupdate does not fire instead locationerror is fired at all times, displaying that the last location provider was disabled

    Steps to reproduce the problem:
    · Create Ext.Map with maprender function and determine the geolocation using Ext.util.geolocation, the locationupdate does not work.

    The result that was expected:
    · The location update needs to fire and return the user’s current location(latitude,longtitude)

    The result that occurs instead:
    · The user’s location is unavailable.

    Test Case:


    Code:
    var geo = Ext.create('Ext.util.Geolocation', {
    autoUpdate: false,
    listeners: {
    locationupdate: function (geo) {
    var currentLat = geo.getLatitude();
    var currentLng = geo.getLongitude();
    var altitude = geo.getAltitude();
    var speed = geo.getSpeed();
    var heading = geo.getHeading();
    },
    locationerror: function (geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) {
    if (bTimeout)
    Ext.Msg.alert('Timeout occurred', "Could not get current position");
    else
    Ext.Msg.alert('Location Unavailable.', message);
    }

    }
    })
    geo.updateLocation();




    HELPFUL INFORMATION


    Screenshot or Video:

    screen1
    screen1.jpg




    Screen2
    screen2.jpg
    Debugging already done:
    · none

    Possible fix:
    · not provided

    Additional CSS used:
    · none

    Operating System:
    · Windows 7

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Posts
    4
    Vote Rating
    0
    aleshawebsight is on a distinguished road

      0  

    Default Applied PhoneGap's navigator.geolocation but Map not rendering to center location

    Applied PhoneGap's navigator.geolocation but Map not rendering to center location


    <code>
    listeners: {
    maprender: function (comp, map) {


    var lat, lng;
    var geoLocationOptions = { maximumAge: 3000, timeout: 5000, enableHighAccuracy: true };
    navigator.geolocation.getCurrentPosition(geoLocationSuccess, geoLocationError, geoLocationOptions);


    function geoLocationSuccess(position) {
    lat = position.coords.latitude;
    lng = position.coords.longitude;
    Ext.Msg.alert("Geolocation", "Latitude:" + lat + ", Longitude:" + lng);


    marker = new google.maps.Marker({
    map: map,
    position: new google.maps.LatLng(lat, lng),
    title: "here!",
    animation: google.maps.Animation.DROP,
    icon: 'resources/arrow.png'
    });
    map.setOptions({ center: new google.maps.LatLng(lat, lng) });//Not Working
    }


    function geoLocationError() {
    Ext.Msg.alert('Error', 'Error while getting geolocation');
    }
    } //end of maprender
    }


    }
    <code>