Skip to content

Commit 494868b

Browse files
committed
Fix Google Maps satellite mode detection
Fix satellite mode detection in Google Maps for some URLs.
1 parent 21fcadf commit 494868b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/scripts/js/urls/googlemaps.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ function universalToGMUrl(universal) {
2121
// parse the Google Maps url to the universal map location representation
2222
function GMUrlToUniversal(url) {
2323
// check if maps are in satellite mode, or not
24+
// based on https://mstickles.wordpress.com/2015/06/12/gmaps-urls-options/
25+
// the URL should be parsed more thoroughly if we wanted to do this properly, but this seems to work fine for our use case
2426
var type = "basic";
25-
if (url.indexOf("!3m1!1e3") > 0) {
27+
if (RegExp("!3m.!1e3").test(url)) {
2628
type = "satellite";
2729
}
2830

0 commit comments

Comments
 (0)