From 2fa64e74456a4ac7e78698b8dcb967026d2302bf Mon Sep 17 00:00:00 2001
From: Quincy Morgan <2046746+quincylvania@users.noreply.github.com>
Date: Sun, 4 Oct 2020 20:17:44 -0400
Subject: [PATCH] Switch from hyphen to slash for photo parameter separator
(re: #6398)
---
API.md | 4 ++--
modules/renderer/photos.js | 2 +-
modules/services/mapillary.js | 2 +-
modules/services/openstreetcam.js | 2 +-
modules/services/streetside.js | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/API.md b/API.md
index c6447e0f8..9a6f38b83 100644
--- a/API.md
+++ b/API.md
@@ -44,8 +44,8 @@ of iD (e.g. `https://ideditor-release.netlify.app`), the following parameters ar
_Example:_ `photo_overlay=streetside,mapillary,openstreetcam`
_Available values:_ `streetside` (Microsoft Bing), `mapillary`, `mapillary-signs`, `mapillary-map-features`, `openstreetcam`
* __`photo`__ - The service and ID of the street-level photo to show.
- _Example:_ `photo=streetside-718514589`
- _Available prefixes:_ `streetside-`, `mapillary-`, `openstreetcam-`
+ _Example:_ `photo=streetside/718514589`
+ _Available prefixes:_ `streetside/`, `mapillary/`, `openstreetcam/`
* __`presets`__ - A comma-separated list of preset IDs. These will be the only presets the user may select.
_Example:_ `presets=building,highway/residential,highway/unclassified`
* __`rtl=true`__ - Force iD into right-to-left mode (useful for testing).
diff --git a/modules/renderer/photos.js b/modules/renderer/photos.js
index 50e001dc4..7130c386b 100644
--- a/modules/renderer/photos.js
+++ b/modules/renderer/photos.js
@@ -89,7 +89,7 @@ export function rendererPhotos(context) {
var photoIds = hash.photo.replace(/;/g, ',').split(',');
var photoId = photoIds.length && photoIds[0].trim();
- var results = /(.*)-(.*)/g.exec(photoId);
+ var results = /(.*)\/(.*)/g.exec(photoId);
if (results && results.length >= 3) {
var serviceId = results[1];
var photoKey = results[2];
diff --git a/modules/services/mapillary.js b/modules/services/mapillary.js
index 3982d3ce7..f98136025 100644
--- a/modules/services/mapillary.js
+++ b/modules/services/mapillary.js
@@ -540,7 +540,7 @@ export default {
if (!window.mocha) {
var hash = utilStringQs(window.location.hash);
if (imageKey) {
- hash.photo = 'mapillary-' + imageKey;
+ hash.photo = 'mapillary/' + imageKey;
} else {
delete hash.photo;
}
diff --git a/modules/services/openstreetcam.js b/modules/services/openstreetcam.js
index 9756667b5..e3da69fc9 100644
--- a/modules/services/openstreetcam.js
+++ b/modules/services/openstreetcam.js
@@ -560,7 +560,7 @@ export default {
if (!window.mocha) {
var hash = utilStringQs(window.location.hash);
if (imageKey) {
- hash.photo = 'openstreetcam-' + imageKey;
+ hash.photo = 'openstreetcam/' + imageKey;
} else {
delete hash.photo;
}
diff --git a/modules/services/streetside.js b/modules/services/streetside.js
index e6d3b68f6..a74f5e2c2 100644
--- a/modules/services/streetside.js
+++ b/modules/services/streetside.js
@@ -953,7 +953,7 @@ export default {
if (!window.mocha) {
var hash = utilStringQs(window.location.hash);
if (imageKey) {
- hash.photo = 'streetside-' + imageKey;
+ hash.photo = 'streetside/' + imageKey;
} else {
delete hash.photo;
}