From d7145a4520c0fd9721592e45f6688c2930823d0f Mon Sep 17 00:00:00 2001 From: "geo-ghci-int[bot]" <146321879+geo-ghci-int[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:28:27 +0000 Subject: [PATCH] Apply pre-commit fix From the artifact of the previous workflow run --- src/streetview/MapillaryGraphQueryCreator.js | 98 ++++++++++---------- src/streetview/MapillaryService.js | 40 ++++---- 2 files changed, 73 insertions(+), 65 deletions(-) diff --git a/src/streetview/MapillaryGraphQueryCreator.js b/src/streetview/MapillaryGraphQueryCreator.js index 869e6115335..ab08aeac0f3 100644 --- a/src/streetview/MapillaryGraphQueryCreator.js +++ b/src/streetview/MapillaryGraphQueryCreator.js @@ -2,60 +2,60 @@ * Mapillary GraphQueryCreator which allow filtering by organisation_id. */ export default class MapillaryGraphQueryCreator { - /** - * @param {string} organizationId The id of the organization to get images from. - */ - constructor(organizationId) { - this.organizationId = organizationId; + /** + * @param {string} organizationId The id of the organization to get images from. + */ + constructor(organizationId) { + this.organizationId = organizationId; - this.imagesPath = 'images'; - this.sequencePath = 'image_ids'; - this._imageTilesPath = 'tiles'; + this.imagesPath = 'images'; + this.sequencePath = 'image_ids'; + this._imageTilesPath = 'tiles'; - this.coreFields = ['computed_geometry', 'geometry', 'sequence']; - this.idFields = ['id']; - this.spatialFields = [ - 'altitude', - 'atomic_scale', - 'camera_parameters', - 'camera_type', - 'captured_at', - 'compass_angle', - 'computed_altitude', - 'computed_compass_angle', - 'computed_rotation', - 'creator', - 'exif_orientation', - 'height', - 'merge_cc', - 'mesh', - 'organization', - 'quality_score', - 'sfm_cluster', - 'thumb_1024_url', - 'thumb_2048_url', - 'width', - ]; - this.imageTileFields = ['url', 'z', 'x', 'y']; - } + this.coreFields = ['computed_geometry', 'geometry', 'sequence']; + this.idFields = ['id']; + this.spatialFields = [ + 'altitude', + 'atomic_scale', + 'camera_parameters', + 'camera_type', + 'captured_at', + 'compass_angle', + 'computed_altitude', + 'computed_compass_angle', + 'computed_rotation', + 'creator', + 'exif_orientation', + 'height', + 'merge_cc', + 'mesh', + 'organization', + 'quality_score', + 'sfm_cluster', + 'thumb_1024_url', + 'thumb_2048_url', + 'width', + ]; + this.imageTileFields = ['url', 'z', 'x', 'y']; + } - images(imageIds, fields) { - return `image_ids=${imageIds.join(',')}&fields=${fields.join(',')}`; - } + images(imageIds, fields) { + return `image_ids=${imageIds.join(',')}&fields=${fields.join(',')}`; + } - imagesS2(cellId, fields) { - return `organization_id=${this.organizationId}&s2=${cellId}&fields=${fields.join(',')}`; - } + imagesS2(cellId, fields) { + return `organization_id=${this.organizationId}&s2=${cellId}&fields=${fields.join(',')}`; + } - imageTiles(z, fields) { - return `z=${z}&fields=${fields.join(',')}`; - } + imageTiles(z, fields) { + return `z=${z}&fields=${fields.join(',')}`; + } - imageTilesPath(imageId) { - return `${imageId}/${this._imageTilesPath}`; - } + imageTilesPath(imageId) { + return `${imageId}/${this._imageTilesPath}`; + } - sequence(sequenceId) { - return `sequence_id=${sequenceId}`; - } + sequence(sequenceId) { + return `sequence_id=${sequenceId}`; + } } diff --git a/src/streetview/MapillaryService.js b/src/streetview/MapillaryService.js index c925ce7e2b3..ba0c4ed5acc 100644 --- a/src/streetview/MapillaryService.js +++ b/src/streetview/MapillaryService.js @@ -37,7 +37,16 @@ export default class MapillaryService extends StreetviewService { * @param {number} bufferSize The size to add to the bbox buffer. * @param {string} organizationId The id of the organization to get images from. */ - constructor($scope, $timeout, $http, map, handlePanoramaPositionChange, accessToken, bufferSize, organizationId) { + constructor( + $scope, + $timeout, + $http, + map, + handlePanoramaPositionChange, + accessToken, + bufferSize, + organizationId, + ) { super($scope, map, handlePanoramaPositionChange); /** @@ -80,7 +89,6 @@ export default class MapillaryService extends StreetviewService { this.mapillaryElement = document.getElementById('mly'); this.mapillaryElement.hidden = true; import(/* webpackChunkName: "mapillary" */ 'mapillary-js').then((Mapillary) => { - const viewerOptions = { accessToken: this.accessToken_, container: 'mly', @@ -90,18 +98,18 @@ export default class MapillaryService extends StreetviewService { visible: false, }, }, - } + }; if (this.organizationId) { const queryCreator = new MapillaryGraphQueryCreator(this.organizationId); const dataProvider = new Mapillary.GraphDataProvider( - { - accessToken: this.accessToken_ - }, - undefined, - undefined, - queryCreator + { + accessToken: this.accessToken_, + }, + undefined, + undefined, + queryCreator, ); viewerOptions.dataProvider = dataProvider; } @@ -195,15 +203,15 @@ export default class MapillaryService extends StreetviewService { searchImage_(bbox) { const baseUrl = `${MLY_METADATA_ENDPOINT}/images`; const params = new URLSearchParams([ - ['access_token', this.accessToken_], - ['fields', 'id'], - ['bbox', bbox], - ['limit', '1'], - ]) + ['access_token', this.accessToken_], + ['fields', 'id'], + ['bbox', bbox], + ['limit', '1'], + ]); if (this.organizationId) { - params.append('organization_id', this.organizationId) + params.append('organization_id', this.organizationId); } - const path = `${baseUrl}?${params.toString()}` + const path = `${baseUrl}?${params.toString()}`; return this.$http_.get(path).then( /** * @param {any} response object.