问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/23951511/blackberry-10-webworks-with-worklight-geolocation