Phonegap エミュレーターを使用して、Kendo UI Mobile を使用するアプリをテストしたいと考えています。実際のデバイスでテストすると Kendo UI は初期化されますが、Geolocation onSuccess メソッドは呼び出されませんが、Phonegap Emulator では Kendo Ui が初期化されていることさえわかりません。このアプリの実行を手伝ってください
var MYAPP = MYAPP || {};
MYAPP.onSuccess = (function(position)
{
var myLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
map = new google.maps.Map(document.getElementById('map_canvas'), {
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: myLocation,
zoom: 15
});
});
MYAPP.onError = (function(error)
{
alert("error initializing map")
});
MYAPP.run = (function() {
// create the Kendo UI Mobile application
alert("kendo initialized");
MYAPP.app = new kendo.mobile.Application(document.body, { transition: "slide" });
navigator.geolocation.getCurrentPosition(MYAPP.onSuccess, MYAPP.onError);
});
MYAPP.show = (function() {
$(document.body).show();
});
(function() {
if (navigator.userAgent.indexOf('Browzr') > -1) {
// blackberry
setTimeout(MYAPP.run, 250)
} else {
// attach to deviceready event, which is fired when phonegap is all good to go.
document.addEventListener('deviceready', MYAPP.run, false);
alert("hello")
}
})();