2 Replies Latest reply on Feb 18, 2014 11:40 AM by Chris Child

    GeoLocation not being recognized

    Chris Child

      Hi all,


      I'm working on a prototype for getting GPS coordinates off of a MC9500 and I can't seem to figure out why the Rho GeoLocation calls are coming back undefined. I've checked over my build.yml and how I'm using the API calls and they all look as if they're correct.


      My build.yml is below. It appears I've followed the instructions properly by adding the gps flag to the yml, set the extension in the yml to rho-javascript, and adding the javascript tag for the generated rhoapi-modules file to my html page. Once I've done this I call Rho.GeoLocation.latitude or longitude and I get a message saying Rho.GeoLocation.longitude or longitude is undefined. I'm hoping it is just something I've over looked.


      sdkversion: "4.0.0"

      name: "RhoMobileApplication1"

      version: "1.0"

      vendor: "rhomobile"

      build: "debug"

      bbver: "6.0"

      applog: "rholog.txt"


        configuration: "Release"

        sdk: "iphonesimulator6.0"




        BundleIdentifier: "com.rhomobile.rhomobileapplication1"

        BundleURLScheme: "rhomobileapplication1"


        productid: "51597fd0-2471-0131-74d3-54bed939d531"


        uid: "0xe63b1755"


        version: "2.3."



          - barcode

      extensions: ["rho-javascript"]

      app_type: "rhoelements"


        - camera

        - gps

      javascript_application: true





        • Re: GeoLocation not being recognized
          Chris Child

          So I have made a discovery. I did not realize that I was required to add the old 2.2 rho_javascript_api.js when dealing with parts of the API that have not been included with 4.0 until I stumbled across it under the 4.0 API's page. So I've now done that but getting a new error. rho_javascript_api.js, line 105: TypeError: 'undefined' is not a function (evaluating '$.toJSON(cmd)')

            • Re: GeoLocation not being recognized
              Chris Child

              Another update. I opened up the rho_javascript_api.js file and found the text explaining how to get 2.2 and 4.0 API's to work with each other. I've tried to load these from the rho_javascript_api.js and my .html file with no luck. Any suggestions? Or a link to how I need to properly set up these?


              In case you need to use pre-4.0 JS API together with new Common JS API you can

                  involve compatibility layer this way:



                      <!-- required for pre-4.0 JS API -->

                      <script type="text/javascript" src="/public/jquery/jquery-1.6.4.min.js"></script>

                      <script type="text/javascript" src="/public/jquery/jquery.json-2.3.min.js"></script>



                      <!-- pre-4.0 JS API -->

                      <script type="text/javascript" src="/public/js/rho_javascript_api.js"></script>



                      <!-- compatibility layer -->

                      <script type="text/javascript" src="/public/js/rho_common_api_noconflict.js"></script>



                      <!-- new Common JS API -->

                      <script type="text/javascript" charset="utf-8" src="/public/api/rhoapi-modules.js"></script>