Skip to content

Commit

Permalink
Merge pull request #3002 from ProjectSidewalk/2993-fix-new-GSV-links
Browse files Browse the repository at this point in the history
Fixes location of GSV terms of use links
  • Loading branch information
misaugstad authored Aug 19, 2022
2 parents 48c58ca + da10d43 commit 4838d12
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
25 changes: 14 additions & 11 deletions public/javascripts/SVLabel/src/SVLabel/navigation/MapService.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function MapService (canvas, neighborhoodModel, uiMap, params) {
lockDisablePanning: false,
lockDisableWalking : false,
panoLinkListenerSet: false,
bottomLinksClickable: false,
svLinkArrowsLoaded : false,
labelBeforeJumpListenerSet: false,
jumpMsgShown: false,
Expand Down Expand Up @@ -500,14 +501,6 @@ function MapService (canvas, neighborhoodModel, uiMap, params) {
return uiMap.pano.find('svg').parent();
}

/**
* Get layer of bottom terms/report a problem links.
* @returns {*}
*/
function getBottomLinkLayer() {
return $('.gm-style-cc').slice(1, 3);
}

self.getStatus = function (key) {
return status[key];
};
Expand Down Expand Up @@ -1001,11 +994,21 @@ function MapService (canvas, neighborhoodModel, uiMap, params) {
* This method brings the links (<, >) to the view control layer so that a user can click them to walk around.
*/
function makeArrowsAndLinksClickable() {
// Bring the layer with arrows and bottom links forward.
// Bring the links on the bottom of GSV and the mini map to the top layer so they are clickable.
var bottomLinks = $('.gm-style-cc');
if (!status.bottomLinksClickable && bottomLinks.length > 7) {
status.bottomLinksClickable = true;
bottomLinks[0].remove(); // Remove GSV keyboard shortcuts link.
bottomLinks[4].remove(); // Remove mini map keyboard shortcuts link.
bottomLinks[5].remove(); // Remove mini map copyright text (duplicate of GSV).
bottomLinks[7].remove(); // Remove mini map terms of use link (duplicate of GSV).
uiMap.viewControlLayer.append($(bottomLinks[1]).parent().parent());
svl.ui.googleMaps.overlay.append($(bottomLinks[8]).parent().parent());
}

// Bring the layer with arrows forward.
var $navArrows = getNavArrowsLayer();
var $bottomlinks = getBottomLinkLayer();
uiMap.viewControlLayer.append($navArrows);
uiMap.viewControlLayer.append($bottomlinks);

// Add an event listener to the nav arrows to log their clicks.
if (!status.panoLinkListenerSet) {
Expand Down
5 changes: 3 additions & 2 deletions public/javascripts/SVValidate/src/panorama/Panorama.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,11 @@ function Panorama (label) {
function (data, status) {
if (status === google.maps.StreetViewStatus.OK) {
document.getElementById("svv-panorama-date").innerText = moment(data.imageDate).format('MMM YYYY');
// Make Terms of Use & Report a problem links on GSV clickable. Should only be done once.
// Remove Keyboard shortcuts link and make Terms of Use & Report a problem links clickable.
// https://github.com/ProjectSidewalk/SidewalkWebpage/issues/2546
if (!bottomLinksClickable) {
$("#view-control-layer").append($('.gm-style-cc').slice(1, 3));
$('.gm-style-cc')[0].remove();
$("#view-control-layer").append($($('.gm-style-cc')[0]).parent().parent());
bottomLinksClickable = true;
}
} else {
Expand Down

0 comments on commit 4838d12

Please sign in to comment.