Skip to content

Commit

Permalink
Apply pre-commit fix
Browse files Browse the repository at this point in the history
From the artifact of the previous workflow run
  • Loading branch information
geo-ghci-int[bot] committed Nov 25, 2024
1 parent 8729b4f commit d7145a4
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 65 deletions.
98 changes: 49 additions & 49 deletions src/streetview/MapillaryGraphQueryCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
}
}
40 changes: 24 additions & 16 deletions src/streetview/MapillaryService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/**
Expand Down Expand Up @@ -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',
Expand All @@ -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;
}
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit d7145a4

Please sign in to comment.