mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-21 07:46:58 +02:00
@@ -1,5 +1,6 @@
|
||||
import { dispatch as d3_dispatch } from 'd3-dispatch';
|
||||
|
||||
import { services } from '../services';
|
||||
import { utilRebind } from '../util/rebind';
|
||||
import { utilQsString, utilStringQs } from '../util';
|
||||
|
||||
@@ -81,6 +82,23 @@ export function rendererPhotos(context) {
|
||||
if (layer) layer.enabled(true);
|
||||
});
|
||||
}
|
||||
if (hash.photo) {
|
||||
var photoIds = hash.photo.replace(/;/g, ',').split(',');
|
||||
var photoId = photoIds.length && photoIds[0].trim();
|
||||
var results = /(.*)-(.*)/g.exec(photoId);
|
||||
if (results && results.length >= 3) {
|
||||
var serviceId = results[1];
|
||||
var photoKey = results[2];
|
||||
var service = services[serviceId];
|
||||
if (service.ensureViewerLoaded) {
|
||||
service.ensureViewerLoaded(context)
|
||||
.then(function() {
|
||||
service.updateViewer(context, photoKey);
|
||||
service.showViewer(context);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
context.layers().on('change.rendererPhotos', updateStorage);
|
||||
};
|
||||
|
||||
@@ -448,12 +448,6 @@ export default {
|
||||
})
|
||||
.then(function() {
|
||||
that.initViewer(context);
|
||||
|
||||
var hash = utilStringQs(window.location.hash);
|
||||
if (hash.photo) {
|
||||
that.updateViewer(context, hash.photo);
|
||||
that.showViewer(context);
|
||||
}
|
||||
});
|
||||
|
||||
return _loadViewerPromise;
|
||||
@@ -546,7 +540,7 @@ export default {
|
||||
if (!window.mocha) {
|
||||
var hash = utilStringQs(window.location.hash);
|
||||
if (imageKey) {
|
||||
hash.photo = imageKey;
|
||||
hash.photo = 'mapillary-' + imageKey;
|
||||
} else {
|
||||
delete hash.photo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user