Skip to content

Commit

Permalink
Show cyclomedia link to MinTour role
Browse files Browse the repository at this point in the history
  • Loading branch information
rmichaelis committed Jan 17, 2023
1 parent 28130af commit 6d8b0d3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,14 @@ exports.prototype.getUserType = function() {
return this.typeUtilisateur;
};

/**
* @return {string|undefined} The Role.
*/
exports.prototype.getRole = function() {
return this.role;
};


/**
* @return {?number} The Role Id.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,18 +324,22 @@ const exports = function(


if (x !== undefined && y !== undefined) {
var coordinate = version === 3 ?
/** @type {ol.Coordinate} */ (transform([parseFloat(x), parseFloat(y)], srs,
this['map'].getView().getProjection())) :
/** @type {ol.Coordinate} */ (transform([parseFloat(y), parseFloat(x)], srs,
this['map'].getView().getProjection()));
this.setClickCordinate_(coordinate);
this.loadInfoPane_();
if (!this.appGetDevice_.testEnv('xs')) {
this['open'] = true;
this['hiddenContent'] = false;
} else {
this['hiddenContent'] = true;
try {
var coordinate = version === 3 ?
/** @type {ol.Coordinate} */ (transform([parseFloat(x), parseFloat(y)], srs,
this['map'].getView().getProjection())) :
/** @type {ol.Coordinate} */ (transform([parseFloat(y), parseFloat(x)], srs,
this['map'].getView().getProjection()));
this.setClickCordinate_(coordinate);
this.loadInfoPane_();
if (!this.appGetDevice_.testEnv('xs')) {
this['open'] = true;
this['hiddenContent'] = false;
} else {
this['hiddenContent'] = true;
}
} catch(exception) {
console.error(exception);
}
}
}
Expand Down Expand Up @@ -557,7 +561,8 @@ exports.prototype.getLidarUrl = function() {
*/
exports.prototype.isCyclomediaAvailable = function() {
if (this.appUserManager_.getUserType() == 'etat' ||
this.appUserManager_.getUserType() == 'commune') {
this.appUserManager_.getUserType() == 'commune' ||
this.appUserManager_.getRole() == 'MinTour') {
return true;
}
return false;
Expand Down

0 comments on commit 6d8b0d3

Please sign in to comment.