91 lines
3.0 KiB
JavaScript
91 lines
3.0 KiB
JavaScript
import { WebPlugin } from '@capacitor/core';
|
|
export class DumonGeolocationWeb extends WebPlugin {
|
|
constructor() {
|
|
super(...arguments);
|
|
this._mode = 'normal';
|
|
}
|
|
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,
|
|
mode: this._mode,
|
|
speedSource: 'NONE',
|
|
speedImu: 0,
|
|
speedGnss: 0,
|
|
speedDerived: 0,
|
|
};
|
|
}
|
|
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 setGpsMode(options) {
|
|
this._mode = (options === null || options === void 0 ? void 0 : options.mode) === 'driving' ? 'driving' : 'normal';
|
|
}
|
|
async getGnssStatus() {
|
|
return null;
|
|
}
|
|
async getLocationServicesStatus() {
|
|
// Web stub; assume enabled
|
|
return { gpsEnabled: true, networkEnabled: true };
|
|
}
|
|
// Background tracking stubs (no-op on web)
|
|
async startBackgroundTracking(_options) {
|
|
console.info('[dumon-geolocation] startBackgroundTracking is not supported on web.');
|
|
}
|
|
async stopBackgroundTracking() {
|
|
console.info('[dumon-geolocation] stopBackgroundTracking is not supported on web.');
|
|
}
|
|
async isBackgroundTrackingActive() {
|
|
return { active: false };
|
|
}
|
|
async getBackgroundLatestPosition() {
|
|
return null;
|
|
}
|
|
async openBackgroundPermissionSettings() {
|
|
console.info('[dumon-geolocation] openBackgroundPermissionSettings is not supported on web.');
|
|
}
|
|
async openNotificationPermissionSettings() {
|
|
console.info('[dumon-geolocation] openNotificationPermissionSettings is not supported on web.');
|
|
}
|
|
async setAuthTokens(_tokens) {
|
|
console.info('[dumon-geolocation] setAuthTokens is a no-op on web.');
|
|
}
|
|
async clearAuthTokens() {
|
|
console.info('[dumon-geolocation] clearAuthTokens is a no-op on web.');
|
|
}
|
|
async getAuthState() {
|
|
return { present: false };
|
|
}
|
|
async setBackgroundPostUrl(_options) {
|
|
console.info('[dumon-geolocation] setBackgroundPostUrl is not supported on web.');
|
|
}
|
|
async getBackgroundPostUrl() {
|
|
return { url: null };
|
|
}
|
|
}
|
|
//# sourceMappingURL=web.js.map
|