dumon-geolocation/dist/plugin.cjs.js
2025-09-28 19:43:26 +08:00

60 lines
1.7 KiB
JavaScript

'use strict';
var core = require('@capacitor/core');
const DumonGeolocation = core.registerPlugin('DumonGeolocation', {
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.DumonGeolocationWeb()),
});
class DumonGeolocationWeb extends core.WebPlugin {
async startPositioning() {
console.log('DumonGeolocationWeb: startPositioning() called (no-op)');
}
async stopPositioning() {
console.log('DumonGeolocationWeb: stopPositioning() called (no-op)');
}
async getLatestPosition() {
console.log('DumonGeolocationWeb: getLatestPosition() called (returning dummy data)');
return {
source: 'GNSS',
timestamp: Date.now(),
latitude: 0,
longitude: 0,
accuracy: 999,
speed: 0,
acceleration: 0,
directionRad: 0,
isMocked: false,
};
}
async checkAndRequestPermissions() {
console.info('[dumon-geolocation] checkAndRequestPermissions mocked for web.');
return {
location: 'granted',
wifi: 'granted',
};
}
async configureEdgeToEdge(options) {
console.info('[dumon-geolocation] configureEdgeToEdge called on web with:', options);
// No-op
}
async setOptions(_options) {
// No-op on web
}
async getGnssStatus() {
return null;
}
async getLocationServicesStatus() {
// Web stub; assume enabled
return { gpsEnabled: true, networkEnabled: true };
}
}
var web = /*#__PURE__*/Object.freeze({
__proto__: null,
DumonGeolocationWeb: DumonGeolocationWeb
});
exports.DumonGeolocation = DumonGeolocation;
//# sourceMappingURL=plugin.cjs.js.map