Hi, In order to use an expression like:
navigator.geolocation.getCurrentPosition(onSuccess, onError); from an ActionScript file there has to be a definition of the components somewhere for the FlexJS compiler to use. My apologies for misunderstanding what you were trying to do. I thought you were trying to get locations through Google Maps and we have defined that API for ActionScript. If you were to look at the org.apache.cordova.camera package (found in flex-asjs/frameworks/projects/Mobile project), you'll see "navigator" being used within a COMPILE::JS block. This class is not available at the application level. Basically, a package like org.apache.cordova.geolocation needs to be added so that a wrapper class can be made to expose the plugin to applications. I have added this package (org.apache.cordova.geolocation) and class (Geolocation) to the Mobile framework project. You can either wait for the next successful nightly build or pull it down from the Apache FlexJS (flex-asjs) git repository. Note that I only added a single function: public function getCurrentPosition(onSuccess:Function, onError:Function):void to the Geolocation class. I can add more functions from the plugin right now if you need them. If you plan on using a lot of Cordova and would like to contribute to the Apache FlexJS project, you can submit updates via Apache JIRA to the framework yourself and someone on the Apache Flex project (eg, me) can incorporate them. Do this enough and you can become a member of the Apache Flex team! Regards, Peter On 6/21/16, 9:16 AM, "Peter Ent" <p...@adobe.com> wrote: >I am looking into it. >‹peter > >On 6/21/16, 6:30 AM, "PKumar" <prashaku...@gmail.com> wrote: > >>Thanks Peter, >> >>I have successfully added MAP but i need to get the device current >>location >>also. I checked the cordova geolocation plugin but i do not know, how to >>use >>it. check the mentioned plugin URL. >> >>https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-geoloc >>a >>tion/ >> >> >> >>----- >>Regards, >>Prashant >>-- >>View this message in context: >>http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Getting-geolocation >>- >>using-Cordova-tp12878p12908.html >>Sent from the Apache Flex Users mailing list archive at Nabble.com. >