1

我正在研究GEO LOCATION,我需要找出纬度经度国家州名。我正在使用Flash CS6AS3AIR 24.0.0.180版本。它会返回Geolocation.isSupported真的,但是当我添加

geo.setRequestedUpdateInterval(1000);
geo.addEventListener(GeolocationEvent.UPDATE, geolocationUpdateHandler);

Android版本6更高GeolocationEvent.UPDATE版本上不会触发,对于版本5,它运行良好

//In constructor
if (Geolocation.isSupported) 
        { 
            geo = new Geolocation();
            geo.addEventListener(PermissionEvent.PERMISSION_STATUS, onPerm);
            //even adding update and status listeners here also it will not fired.
        } 
        else 
        { 
            log.text = "\n Geolocation not supported"; 
        }
stage.addEventListener(MouseEvent.CLICK, onClick);

private function onClick(e:MouseEvent):void
    {
        geo.requestPermission(); //here it is asking for permission.
    }

private function onPerm(e:PermissionEvent):void
    {
        //Permission event shows GRANTED when i click on allow.
        log.appendText("\n PermissionEvent : " + e.status.toUpperCase() + " !geo.muted :"+!geo.muted+"\n");
        if (!geo.muted) //true
        { 
            geo.addEventListener(GeolocationEvent.UPDATE, geoUpdateHandler); //these events are not fired. 
        } 
        geo.addEventListener(StatusEvent.STATUS, geoStatusHandler);//these events are not fired.
    }
4

0 回答 0