mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Use consistent short service name
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
select as d3_select
|
||||
} from 'd3-selection';
|
||||
|
||||
import { osmEntity, osmNote, krError, impOsmError } from '../osm';
|
||||
import { osmEntity, osmNote, krError, iOsmError } from '../osm';
|
||||
import { utilKeybinding, utilRebind } from '../util';
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ export function behaviorHover(context) {
|
||||
selector = '.data' + datum.__featurehash__;
|
||||
|
||||
} else if (
|
||||
datum instanceof impOsmError ||
|
||||
datum instanceof iOsmError ||
|
||||
datum instanceof krError
|
||||
) {
|
||||
entity = datum;
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
import {
|
||||
osmEntity,
|
||||
osmNote,
|
||||
impOsmError,
|
||||
iOsmError,
|
||||
krError
|
||||
} from '../osm';
|
||||
|
||||
@@ -171,7 +171,7 @@ export function behaviorSelect(context) {
|
||||
context
|
||||
.selectedNoteID(datum.id)
|
||||
.enter(modeSelectNote(context, datum.id));
|
||||
} else if (datum instanceof impOsmError & !isMultiselect) { // clicked an improveOSM error
|
||||
} else if (datum instanceof iOsmError & !isMultiselect) { // clicked an improveOSM error
|
||||
context
|
||||
.selectedErrorID(datum.id)
|
||||
.enter(modeSelectError(context, datum.id, datum.source));
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import _extend from 'lodash-es/extend';
|
||||
|
||||
|
||||
export function impOsmError() {
|
||||
if (!(this instanceof impOsmError)) {
|
||||
return (new impOsmError()).initialize(arguments);
|
||||
export function iOsmError() {
|
||||
if (!(this instanceof iOsmError)) {
|
||||
return (new iOsmError()).initialize(arguments);
|
||||
} else if (arguments.length) {
|
||||
this.initialize(arguments);
|
||||
}
|
||||
@@ -11,17 +11,17 @@ export function impOsmError() {
|
||||
|
||||
// ImproveOSM has no error IDs unfortunately
|
||||
// So no way to explicitly refer to each error in their DB
|
||||
impOsmError.id = function() {
|
||||
return impOsmError.id.next--;
|
||||
iOsmError.id = function() {
|
||||
return iOsmError.id.next--;
|
||||
};
|
||||
|
||||
|
||||
impOsmError.id.next = -1;
|
||||
iOsmError.id.next = -1;
|
||||
|
||||
|
||||
_extend(impOsmError.prototype, {
|
||||
_extend(iOsmError.prototype, {
|
||||
|
||||
type: 'impOsmError',
|
||||
type: 'iOsmError',
|
||||
source: 'iOSM',
|
||||
|
||||
initialize: function(sources) {
|
||||
@@ -39,13 +39,13 @@ _extend(impOsmError.prototype, {
|
||||
}
|
||||
|
||||
if (!this.id) {
|
||||
this.id = impOsmError.id() + ''; // as string
|
||||
this.id = iOsmError.id() + ''; // as string
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
update: function(attrs) {
|
||||
return impOsmError(this, attrs); // {v: 1 + (this.v || 0)}
|
||||
return iOsmError(this, attrs); // {v: 1 + (this.v || 0)}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export { osmChangeset } from './changeset';
|
||||
export { osmEntity } from './entity';
|
||||
export { krError } from './keepRight';
|
||||
export { impOsmError } from './improveOSM';
|
||||
export { iOsmError } from './improveOSM';
|
||||
export { osmNode } from './node';
|
||||
export { osmNote } from './note';
|
||||
export { osmRelation } from './relation';
|
||||
|
||||
@@ -9,7 +9,7 @@ import { json as d3_json } from 'd3-request';
|
||||
import { request as d3_request } from 'd3-request';
|
||||
|
||||
import { geoExtent } from '../geo';
|
||||
import { impOsmError } from '../osm';
|
||||
import { iOsmError } from '../osm';
|
||||
import { services } from './index';
|
||||
import { t } from '../util/locale';
|
||||
import { utilRebind, utilTiler, utilQsString } from '../util';
|
||||
@@ -183,7 +183,7 @@ export default {
|
||||
|
||||
var dir_of_travel = cardinalDirection(relativeBearing(p1, p2));
|
||||
|
||||
var d = new impOsmError({
|
||||
var d = new iOsmError({
|
||||
loc: pointAverage(feature.points), // TODO: This isn't great for curved roads, would be better to find actual midpoint of segment
|
||||
comments: null,
|
||||
error_subtype: '',
|
||||
@@ -223,7 +223,7 @@ export default {
|
||||
path: 'maki-shoe'
|
||||
};
|
||||
|
||||
var d = new impOsmError({
|
||||
var d = new iOsmError({
|
||||
loc: pointAverage(feature.points),
|
||||
comments: null,
|
||||
error_subtype: geoType,
|
||||
@@ -259,7 +259,7 @@ export default {
|
||||
|
||||
var dir_of_travel = cardinalDirection(relativeBearing(p1, p2));
|
||||
|
||||
var d = new impOsmError({
|
||||
var d = new iOsmError({
|
||||
loc: [loc.lon, loc.lat],
|
||||
comments: null,
|
||||
error_subtype: '',
|
||||
@@ -374,7 +374,7 @@ export default {
|
||||
|
||||
// replace a single error in the cache
|
||||
replaceError: function(error) {
|
||||
if (!(error instanceof impOsmError) || !error.id) return;
|
||||
if (!(error instanceof iOsmError) || !error.id) return;
|
||||
|
||||
_erCache.data[error.id] = error;
|
||||
updateRtree(encodeErrorRtree(error), true); // true = replace
|
||||
@@ -383,7 +383,7 @@ export default {
|
||||
|
||||
// remove a single error from the cache
|
||||
removeError: function(error) {
|
||||
if (!(error instanceof impOsmError) || !error.id) return;
|
||||
if (!(error instanceof iOsmError) || !error.id) return;
|
||||
|
||||
delete _erCache.data[error.id];
|
||||
updateRtree(encodeErrorRtree(error), false); // false = remove
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
selectAll as d3_selectAll
|
||||
} from 'd3-selection';
|
||||
|
||||
import { osmEntity, osmNote, impOsmError, krError } from '../osm';
|
||||
import { osmEntity, osmNote, iOsmError, krError } from '../osm';
|
||||
import { services } from '../services';
|
||||
import {
|
||||
uiDataEditor,
|
||||
@@ -140,7 +140,7 @@ export function uiSidebar(context) {
|
||||
selection.selectAll('.sidebar-component')
|
||||
.classed('inspector-hover', true);
|
||||
|
||||
} else if (datum instanceof impOsmError) {
|
||||
} else if (datum instanceof iOsmError) {
|
||||
_wasIOsmError = true;
|
||||
|
||||
var improveOSM = services.improveOSM;
|
||||
|
||||
Reference in New Issue
Block a user