forked from paul/sinoptik
Use address instead of position for map debug handler
This commit is contained in:
parent
4920ab4abd
commit
f1a303edc0
|
@ -61,16 +61,19 @@ async fn forecast_geo(
|
|||
/// Handler for showing the current map with the geocoded position for a specific metric.
|
||||
///
|
||||
/// Note: This handler is mosly used for debugging purposes!
|
||||
#[get("/map?<lat>&<lon>&<metric>")]
|
||||
#[get("/map?<address>&<metric>")]
|
||||
async fn show_map(
|
||||
lat: f64,
|
||||
lon: f64,
|
||||
address: String,
|
||||
metric: Metric,
|
||||
maps_handle: &State<MapsHandle>,
|
||||
) -> Option<Custom<Vec<u8>>> {
|
||||
use image::{GenericImage, Rgba};
|
||||
use std::io::Cursor;
|
||||
|
||||
let position = resolve_address(address).await?;
|
||||
let lat = position.lat;
|
||||
let lon = position.lon;
|
||||
|
||||
let now = Instant::now();
|
||||
let maps = maps_handle.lock().expect("Maps handle lock was poisoned");
|
||||
let mut image = match metric {
|
||||
|
|
Loading…
Reference in New Issue