#![allow(clippy::unused_async)]
use super::MapHandle;
use crate::types::{Bounds, LatLng};
#[cfg(target_arch = "wasm32")]
use dioxus::prelude::document;
impl MapHandle {
#[cfg(target_arch = "wasm32")]
pub async fn get_zoom(&self) -> Option<f64> {
let js = crate::interop::get_zoom_js(&self.map_id);
document::eval(&js).join::<f64>().await.ok()
}
#[cfg(target_arch = "wasm32")]
pub async fn get_center(&self) -> Option<LatLng> {
let js = crate::interop::get_center_js(&self.map_id);
document::eval(&js).join::<LatLng>().await.ok()
}
#[cfg(target_arch = "wasm32")]
pub async fn get_bearing(&self) -> Option<f64> {
let js = crate::interop::get_bearing_js(&self.map_id);
document::eval(&js).join::<f64>().await.ok()
}
#[cfg(target_arch = "wasm32")]
pub async fn get_pitch(&self) -> Option<f64> {
let js = crate::interop::get_pitch_js(&self.map_id);
document::eval(&js).join::<f64>().await.ok()
}
#[cfg(target_arch = "wasm32")]
pub async fn get_bounds(&self) -> Option<Bounds> {
let js = crate::interop::get_bounds_js(&self.map_id);
document::eval(&js).join::<Bounds>().await.ok()
}
#[cfg(not(target_arch = "wasm32"))]
pub async fn get_zoom(&self) -> Option<f64> {
None
}
#[cfg(not(target_arch = "wasm32"))]
pub async fn get_center(&self) -> Option<LatLng> {
None
}
#[cfg(not(target_arch = "wasm32"))]
pub async fn get_bearing(&self) -> Option<f64> {
None
}
#[cfg(not(target_arch = "wasm32"))]
pub async fn get_pitch(&self) -> Option<f64> {
None
}
#[cfg(not(target_arch = "wasm32"))]
pub async fn get_bounds(&self) -> Option<Bounds> {
None
}
}