黑莓10 Webworks与Worklight地理位置 [英] Blackberry 10 Webworks with Worklight Geolocation

查看:309
本文介绍了黑莓10 Webworks与Worklight地理位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Worklight 6.1和BlackBerry 10的WebWorks SdK 2.1。



我的问题是当我尝试获取用户位置调用此函数时:

  navigator.geolocation.getCurrentPosition(
onSuccessGeo,onErrorGeo,{enableHighAccuracy:true});

我收到此错误:


TypeError:'undefined'不是一个对象(评估'e.code')geolocation.js:115


虽然当我运行基于Webworks SDK 2.1的示例项目,使用cordova,地理定位工作正常。



我对这两个项目使用Worklight和Worklight都做了相同的配置和权限。



我错了什么?

解决方案

我解决了这个问题通过替换Worklight的Geolocation插件由Webworks SDK 2.1生成的。 p>

因此您必须复制地理位置插件:

  ProjectFolder / plugin /org.apache.cordova.geolocation 

并过过

  /ProjectFolder/webresources/default/worklight/plugins/org.apache.cordova.geolocation 

>



------->





这是所有,希望如果你会遇到这样的问题,它会帮助你。


I'm working with Worklight 6.1 and WebWorks SdK 2.1 for BlackBerry 10.

my issue is when I try to get the User location invoking this function :

navigator.geolocation.getCurrentPosition(
    onSuccessGeo, onErrorGeo, {enableHighAccuracy: true});

I get this error :

TypeError: 'undefined' is not an object (evaluating 'e.code') geolocation.js:115

Though when I run a sample project based on Webworks SDK 2.1, with cordova, the geolocation works fine.

I made the same configuration and permissions for the 2 projects, both with Worklight and without Worklight.

Did I miss something?

解决方案

I resolved this issue by replacing Geolocation plugin of Worklight by the one generated by Webworks SDK 2.1.

So you have to copy the Geolocation Plugin under :

ProjectFolder/plugin/org.apache.cordova.geolocation

and past it under :

/ProjectFolder/webresources/default/worklight/plugins/org.apache.cordova.geolocation

------->

That's all, hope it will help you if you'll face such problem.

这篇关于黑莓10 Webworks与Worklight地理位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆