Add ll parsing
This commit is contained in:
parent
1806488692
commit
280fb7a5ef
@ -85,6 +85,14 @@ impl CoordinateUrls {
|
|||||||
return Ok(("", ret));
|
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)
|
context("latlon not found in url", fail)(i)
|
||||||
@ -296,5 +304,11 @@ mod tests {
|
|||||||
35.7224075,
|
35.7224075,
|
||||||
-78.4170755
|
-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
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user