React native 使用android仿真器而不使用Expo来模拟react原生地图内部移动的最佳方法?
使用Android仿真器在react原生地图中模拟移动的最佳方式是什么?我知道您可以在“位置设置”菜单中加载gpx文件。但是,这只适用于模拟器内的google maps,而不是使用react本机地图的自定义应用程序 我也知道,可以使用世博会位置库模拟用户移动React native 使用android仿真器而不使用Expo来模拟react原生地图内部移动的最佳方法?,react-native,android-emulator,react-native-maps,React Native,Android Emulator,React Native Maps,使用Android仿真器在react原生地图中模拟移动的最佳方式是什么?我知道您可以在“位置设置”菜单中加载gpx文件。但是,这只适用于模拟器内的google maps,而不是使用react本机地图的自定义应用程序 我也知道,可以使用世博会位置库模拟用户移动 import * as Location from 'expo-location'; const tenMetersWithDegrees = 0.0001; const getLocation = increment =
import * as Location from 'expo-location';
const tenMetersWithDegrees = 0.0001;
const getLocation = increment => {
return {
timestamp: 100000,
coords: {
speed: 0,
heading: 0,
accuracy: 5,
altitudeAccuracy: 5,
altitude: 5,
longitude: -122.9779983 + increment * tenMetersWithDegrees,
latitude: 37.5665 + increment * tenMetersWithDegrees,
}
}
}
let counter = 0;
setInterval(() => {
Location.EventEmitter.emit('Expo.locationChanged', {
watchId: Location._getCurrentWatchI(),
location: getLocation(count)
})
counter++
}, 1000);
是否可以使用just react native geolocation service构建相同类型的脚本?使用android emulator,您可以模拟路由。检查下面的屏幕截图