From 348f20641c8a3dcd3fb16ddeec8867d0a9d55b1b Mon Sep 17 00:00:00 2001 From: geoffsee <> Date: Tue, 8 Jul 2025 14:07:46 -0400 Subject: [PATCH] disable webview spawn for wasm32 --- crates/yachtpit/src/ui/gps_map.rs | 55 ++++++++++++++++--------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/crates/yachtpit/src/ui/gps_map.rs b/crates/yachtpit/src/ui/gps_map.rs index 85008b1..3f4606a 100644 --- a/crates/yachtpit/src/ui/gps_map.rs +++ b/crates/yachtpit/src/ui/gps_map.rs @@ -2,7 +2,7 @@ use bevy::prelude::*; use bevy::render::view::RenderLayers; use bevy::window::Window; use std::collections::HashMap; -use bevy_webview_wry::prelude::*; + /// Render layer for GPS map entities to isolate them from other cameras @@ -143,37 +143,40 @@ pub fn spawn_gps_map_window(commands: &mut Commands, gps_map_state: &mut ResMut< info!("Spawning GPS map window"); + // todo: expose an attribute for element positioning // Create a new window for the GPS map - let window_entity = commands - .spawn(( - Window { - title: "GPS Navigation - OpenStreetMap".to_string(), - resolution: (800.0, 600.0).into(), - position: bevy::window::WindowPosition::Centered( - bevy::window::MonitorSelection::Current, - ), - ..default() - }, - GpsMapWindow, - )) - .id(); + // let window_entity = commands + // .spawn(( + // Window { + // title: "GPS Navigation - OpenStreetMap".to_string(), + // resolution: (800.0, 600.0).into(), + // position: bevy::window::WindowPosition::Centered( + // bevy::window::MonitorSelection::Current, + // ), + // ..default() + // }, + // GpsMapWindow, + // )) + // .id(); + // todo: expose an attribute for element positioning // Create a camera for the map window - commands.spawn(( - Camera2d, - Camera { - target: bevy::render::camera::RenderTarget::Window(bevy::window::WindowRef::Entity( - window_entity, - )), - ..default() - }, - RenderLayers::layer(GPS_MAP_LAYER), - GpsMapWindow, - )); + // commands.spawn(( + // Camera2d, + // Camera { + // target: bevy::render::camera::RenderTarget::Window(bevy::window::WindowRef::Entity( + // window_entity, + // )), + // ..default() + // }, + // RenderLayers::layer(GPS_MAP_LAYER), + // GpsMapWindow, + // )); - gps_map_state.window_id = Some(window_entity); + // gps_map_state.window_id = Some(window_entity); + #[cfg(not(target_arch = "wasm32"))] info!("GPS map window spawned with entity: {:?}", window_entity);