mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
Fix android and web builds
This commit is contained in:
parent
08495f2784
commit
47bc085774
@ -29,7 +29,7 @@ impl Default for ScheduleMethod {
|
||||
}
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
{
|
||||
ScheduleMethod::Tokio(crate::platform::scheduler::WebWorkerScheduleMethod::new())
|
||||
ScheduleMethod::WebWorker(crate::platform::scheduler::WebWorkerScheduleMethod::new())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,7 +30,13 @@ pub struct Map {
|
||||
impl Map {
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
pub async fn run_async(self) {
|
||||
main_loop::run(self.window, self.event_loop, self.scheduler).await;
|
||||
main_loop::run(
|
||||
self.window,
|
||||
self.event_loop,
|
||||
self.scheduler,
|
||||
Box::new(self.style),
|
||||
)
|
||||
.await;
|
||||
}
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
|
||||
@ -21,10 +21,15 @@ pub async fn run(
|
||||
style: Box<Style>,
|
||||
) {
|
||||
let mut input = InputController::new(0.2, 100.0, 0.1);
|
||||
let mut maybe_state: Option<RenderState> = if cfg!(target_os = "android") {
|
||||
None
|
||||
} else {
|
||||
Some(RenderState::new(&window, style).await)
|
||||
let mut maybe_state: Option<RenderState> = {
|
||||
#[cfg(target_os = "android")]
|
||||
{
|
||||
None
|
||||
}
|
||||
#[cfg(not(target_os = "android"))]
|
||||
{
|
||||
Some(RenderState::new(&window, style).await)
|
||||
}
|
||||
};
|
||||
|
||||
let mut last_render_time = Instant::now();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user