Crates.io | dioxus-geolocation |
lib.rs | dioxus-geolocation |
version | |
source | src |
created_at | 2025-04-13 05:14:02.909951+00 |
updated_at | 2025-04-18 23:48:34.490091+00 |
description | Geolocation utilities and hooks for Dioxus. |
homepage | https://dioxuslabs.com |
repository | https://github.com/DioxusLabs/sdk/ |
max_upload_size | |
id | 1631524 |
Cargo.toml error: | TOML parse error at line 24, column 1 | 24 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Geolocation utilities and hooks for Dioxus.
Add dioxus-geolocation
to your Cargo.toml
:
[dependencies]
dioxus-geolocation = "0.1"
Example:
use dioxus::prelude::*;
use dioxus_geolocation::{
init_geolocator, use_geolocation, PowerMode
};
#[component]
fn App() -> Element {
let geolocator = init_geolocator(PowerMode::High).unwrap();
let coords = use_geolocation();
match coords {
Ok(coords) => {
rsx!( p { "Latitude: {coords.latitude} | Longitude: {coords.longitude}" } )
}
Err(Error::NotInitialized) => {
rsx!( p { "Initializing..." } )
}
Err(e) => {
rsx!( p { "An error occurred {e}" } )
}
}
}
This table represents the compatibility between this crate and Dioxus versions. The crate version supports a Dioxus version up until the next crate version in the table.
E.g. if crate version 0.1
supported Dioxus 0.6
and crate version 0.4
supported Dioxus 0.7
, crate versions 0.1
, 0.2
, and 0.3
would support Dioxus 0.6
.
Crate Version | Dioxus Version |
---|---|
0.1 | 0.6 |