Add ll parsing

This commit is contained in:
Austen Adler 2023-04-27 21:49:52 -04:00
parent 1806488692
commit 280fb7a5ef

View File

@ -85,6 +85,14 @@ impl CoordinateUrls {
return Ok(("", ret));
}
}
// From: https://help.parsehub.com/hc/en-us/articles/226061627-Scrape-latitude-and-longitude-data-from-a-Google-Maps-link
// https://maps.google.com/maps?ll=43.6474528,-79.3799409,&z=16&t=m&hl=en-US&gl=US&mapclient=apiv3):
if key == "ll" {
if let Ok((_str, ret)) = LatLon::parse(value.as_ref()) {
return Ok(("", ret));
}
}
}
context("latlon not found in url", fail)(i)
@ -296,5 +304,11 @@ mod tests {
35.7224075,
-78.4170755
);
p!(
"https://maps.google.com/maps?ll=43.6474528,-79.3799409,&z=16&t=m&hl=en-US&gl=US&mapclient=apiv3):",
43.6474528,
-79.3799409
);
}
}