Fix more namespaces that were missed in the first pass

This commit is contained in:
Bryan Housel
2016-10-04 21:15:30 -04:00
parent 66348e4a18
commit 0d0e54fdff
23 changed files with 54 additions and 55 deletions

View File

@@ -10,7 +10,7 @@ import { actionDeleteNode } from './delete_node';
// Tags and relation memberships of of non-surviving nodes are merged
// to the survivor.
//
// This is the inverse of `iD.actions.Disconnect`.
// This is the inverse of `iD.actionDisconnect`.
//
// Reference:
// https://github.com/openstreetmap/potlatch2/blob/master/net/systemeD/halcyon/connection/actions/MergeNodesAction.as

View File

@@ -9,7 +9,7 @@ import { coreNode } from '../core/index';
// Normally, this will be undefined and the way will automatically
// be assigned a new ID.
//
// This is the inverse of `iD.actions.Connect`.
// This is the inverse of `iD.actionConnect`.
//
// Reference:
// https://github.com/openstreetmap/potlatch2/blob/master/net/systemeD/halcyon/connection/actions/UnjoinNodeAction.as

View File

@@ -6,7 +6,7 @@ import { geoJoinWays } from '../geo/index';
// Join ways at the end node they share.
//
// This is the inverse of `iD.actions.Split`.
// This is the inverse of `iD.actionSplit`.
//
// Reference:
// https://github.com/systemed/potlatch2/blob/master/net/systemeD/halcyon/connection/actions/MergeWaysAction.as

View File

@@ -213,7 +213,7 @@ export function actionMergeRemoteChanges(id, localGraph, remoteGraph, formatUser
// delete/undelete
if (!remote.visible) {
if (option === 'force_remote') {
return DeleteMultiple([id])(graph);
return actionDeleteMultiple([id])(graph);
} else if (option === 'force_local') {
if (target.type === 'way') {

View File

@@ -10,7 +10,7 @@ import { utilWrap } from '../util/index';
// Optionally, split only the given ways, if multiple ways share
// the given node.
//
// This is the inverse of `iD.actions.Join`.
// This is the inverse of `iD.actionJoin`.
//
// For testing convenience, accepts an ID to assign to the new way.
// Normally, this will be undefined and the way will automatically

View File

@@ -422,7 +422,7 @@ export function coreConnection(useHttps) {
return {
id: tile.toString(),
extent: Extent(
extent: geoExtent(
projection.invert([x, y + ts]),
projection.invert([x + ts, y]))
};

View File

@@ -296,14 +296,14 @@ export function coreHistory(context) {
var allEntities = {};
h.entities.forEach(function(entity) {
allEntities[coreEntity.key(entity)] = Entity(entity);
allEntities[coreEntity.key(entity)] = coreEntity(entity);
});
if (h.version === 3) {
// This merges originals for changed entities into the base of
// the stack even if the current stack doesn't have them (for
// example when iD has been restarted in a different region)
var baseEntities = h.baseEntities.map(function(d) { return Entity(d); });
var baseEntities = h.baseEntities.map(function(d) { return coreEntity(d); });
stack[0].graph.rebase(baseEntities, _.map(stack, 'graph'), true);
tree.rebase(baseEntities, true);
@@ -382,7 +382,7 @@ export function coreHistory(context) {
for (var i in d.entities) {
var entity = d.entities[i];
entities[i] = entity === 'undefined' ? undefined : Entity(entity);
entities[i] = entity === 'undefined' ? undefined : coreEntity(entity);
}
d.graph = coreGraph(stack[0].graph).load(entities);

View File

@@ -32,10 +32,10 @@ _.extend(geoExtent.prototype, {
extend: function(obj) {
if (!(obj instanceof geoExtent)) obj = new geoExtent(obj);
return Extent([Math.min(obj[0][0], this[0][0]),
Math.min(obj[0][1], this[0][1])],
[Math.max(obj[1][0], this[1][0]),
Math.max(obj[1][1], this[1][1])]);
return geoExtent(
[Math.min(obj[0][0], this[0][0]), Math.min(obj[0][1], this[0][1])],
[Math.max(obj[1][0], this[1][0]), Math.max(obj[1][1], this[1][1])]
);
},
@@ -80,7 +80,7 @@ _.extend(geoExtent.prototype, {
contains: function(obj) {
if (!(obj instanceof Extent)) obj = new geoExtent(obj);
if (!(obj instanceof geoExtent)) obj = new geoExtent(obj);
return obj[0][0] >= this[0][0] &&
obj[0][1] >= this[0][1] &&
obj[1][0] <= this[1][0] &&
@@ -89,7 +89,7 @@ _.extend(geoExtent.prototype, {
intersects: function(obj) {
if (!(obj instanceof Extent)) obj = new geoExtent(obj);
if (!(obj instanceof geoExtent)) obj = new geoExtent(obj);
return obj[0][0] <= this[1][0] &&
obj[0][1] <= this[1][1] &&
obj[1][0] >= this[0][0] &&
@@ -99,15 +99,15 @@ _.extend(geoExtent.prototype, {
intersection: function(obj) {
if (!this.intersects(obj)) return new geoExtent();
return new Extent([Math.max(obj[0][0], this[0][0]),
Math.max(obj[0][1], this[0][1])],
[Math.min(obj[1][0], this[1][0]),
Math.min(obj[1][1], this[1][1])]);
return new geoExtent(
[Math.max(obj[0][0], this[0][0]), Math.max(obj[0][1], this[0][1])],
[Math.min(obj[1][0], this[1][0]), Math.min(obj[1][1], this[1][1])]
);
},
percentContainedIn: function(obj) {
if (!(obj instanceof Extent)) obj = new geoExtent(obj);
if (!(obj instanceof geoExtent)) obj = new geoExtent(obj);
var a1 = this.intersection(obj).area(),
a2 = this.area();
@@ -122,9 +122,10 @@ _.extend(geoExtent.prototype, {
padByMeters: function(meters) {
var dLat = geoMetersToLat(meters),
dLon = geoMetersToLon(meters, this.center()[1]);
return Extent(
[this[0][0] - dLon, this[0][1] - dLat],
[this[1][0] + dLon, this[1][1] + dLat]);
return geoExtent(
[this[0][0] - dLon, this[0][1] - dLat],
[this[1][0] + dLon, this[1][1] + dLat]
);
},

View File

@@ -124,7 +124,7 @@ export function geoAngle(a, b, projection) {
// the closest vertex on that edge. Returns an object with the `index` of the
// chosen edge, the chosen `loc` on that edge, and the `distance` to to it.
export function geoChooseEdge(nodes, point, projection) {
var dist = euclideanDistance,
var dist = geoEuclideanDistance,
points = nodes.map(function(n) { return projection(n.loc); }),
min = Infinity,
idx, loc;
@@ -192,7 +192,7 @@ export function geoLineIntersection(a, b) {
t = crossProduct(subtractPoints(q, p), s) / denominator;
if ((t >= 0) && (t <= 1) && (u >= 0) && (u <= 1)) {
return interp(p, p2, t);
return geoInterp(p, p2, t);
}
}

View File

@@ -70,7 +70,7 @@ export function geoSimpleMultipolygonOuterMember(entity, graph) {
// used.
//
// If an member has a `tags` property, its tags will be reversed via
// `iD.actions.Reverse` in the output.
// `iD.actionReverse` in the output.
//
// Incomplete members (those for which `graph.hasEntity(element.id)` returns
// false) and non-way members are ignored.

View File

@@ -14,7 +14,7 @@ export function modeAddPoint(context) {
key: '1'
};
var behavior = behavriorDraw(context)
var behavior = behaviorDraw(context)
.tail(t('modes.add_point.tail'))
.on('click', add)
.on('clickWay', addWay)

View File

@@ -88,15 +88,13 @@ export function modeDragNode(context) {
if (wasMidpoint) {
var midpoint = entity;
entity = coreNode();
context.perform(AddMidpoint(midpoint, entity));
context.perform(actionAddMidpoint(midpoint, entity));
var vertex = context.surface()
.selectAll('.' + entity.id);
behavior.target(vertex.node(), entity);
var vertex = context.surface().selectAll('.' + entity.id);
behavior.target(vertex.node(), entity);
} else {
context.perform(
actionNoop());
context.perform(actionNoop());
}
activeIDs = _.map(context.graph().parentWays(entity), 'id');

View File

@@ -163,7 +163,7 @@ export function rendererBackground(context) {
}
}
layer = TileLayer(context)
layer = rendererTileLayer(context)
.source(d)
.projection(context.projection)
.dimensions(baseLayer.dimensions());
@@ -212,7 +212,7 @@ export function rendererBackground(context) {
}
});
backgroundSources.unshift(BackgroundSource.None());
backgroundSources.unshift(rendererBackgroundSource.None());
if (!chosen && extent) {
best = _.find(this.sources(extent), function(s) { return s.best(); });

View File

@@ -1,9 +1,9 @@
import * as d3 from 'd3';
import { geoPolygonIntersectsPolygon } from '../geo/index';
import {
dataImperial as imperialData,
dataDriveLeft as driveLeftData,
dataImagery as imageryData
dataImperial,
dataDriveLeft,
dataImagery
} from '../../data/index';

View File

@@ -114,23 +114,23 @@ export function svgGpx(projection, context, dispatch) {
drawGpx.enabled = function(_) {
if (!arguments.length) return Gpx.enabled;
Gpx.enabled = _;
if (!arguments.length) return svgGpx.enabled;
svgGpx.enabled = _;
dispatch.call('change');
return this;
};
drawGpx.hasGpx = function() {
var geojson = Gpx.geojson;
var geojson = svgGpx.geojson;
return (!(_.isEmpty(geojson) || _.isEmpty(geojson.features)));
};
drawGpx.geojson = function(gj) {
if (!arguments.length) return Gpx.geojson;
if (!arguments.length) return svgGpx.geojson;
if (_.isEmpty(gj) || _.isEmpty(gj.features)) return this;
Gpx.geojson = gj;
svgGpx.geojson = gj;
dispatch.call('change');
return this;
};
@@ -162,7 +162,7 @@ export function svgGpx(projection, context, dispatch) {
drawGpx.fitZoom = function() {
if (!this.hasGpx()) return this;
var geojson = Gpx.geojson;
var geojson = svgGpx.geojson;
var map = context.map(),
viewport = map.trimmedExtent().polygon(),

View File

@@ -58,7 +58,7 @@ export function svgLines(projection) {
_.forOwn(pathdata, function(v, k) {
onewaydata[k] = _(v)
.filter(function(d) { return d.isOneWay(); })
.map(OneWaySegments(projection, graph, 35))
.map(svgOneWaySegments(projection, graph, 35))
.flatten()
.valueOf();
});

View File

@@ -111,7 +111,7 @@ export function svgMidpoints(projection, context) {
groups = groups
.merge(enter)
.attr('transform', function(d) {
var translate = PointTransform(projection),
var translate = svgPointTransform(projection),
a = graph.entity(d.edge[0]),
b = graph.entity(d.edge[1]),
angleVal = Math.round(geoAngle(a, b, projection) * (180 / Math.PI));

View File

@@ -41,7 +41,7 @@ export function uiDisclosure() {
function toggle() {
expanded = !expanded;
hideToggle.classed('expanded', expanded);
div.call(Toggle(expanded));
wrap.call(uiToggle(expanded));
dispatch.call('toggled', this, expanded);
}
};

View File

@@ -35,7 +35,7 @@ export function uiLasso(context) {
lasso.extent = function () {
return lasso.coordinates.reduce(function(extent, point) {
return extent.extend(Extent(point));
return extent.extend(geoExtent(point));
}, geoExtent());
};

View File

@@ -189,7 +189,7 @@ export function uiMapInMap(context) {
var activeOverlayLayers = [];
for (var i = 0; i < overlaySources.length; i++) {
if (overlaySources[i].validZoom(zMini)) {
if (!overlayLayers[i]) overlayLayers[i] = TileLayer(context);
if (!overlayLayers[i]) overlayLayers[i] = rendererTileLayer(context);
activeOverlayLayers.push(overlayLayers[i]
.source(overlaySources[i])
.projection(projection)

View File

@@ -24,7 +24,7 @@ export function uiPreset(context) {
function UIField(field, entity, show) {
field = _.clone(field);
field.input = fields[field.type](field, context)
field.input = uiFields[field.type](field, context)
.on('change', function(t, onInput) {
dispatch.call('change', field, t, onInput);
});

View File

@@ -43,7 +43,7 @@ export function uiSave(context) {
var tooltipBehavior = tooltip()
.placement('bottom')
.html(true)
.title(tooltipHtml(t('save.no_changes'), key));
.title(uiTooltipHtml(t('save.no_changes'), key));
var button = selection
.append('button')
@@ -77,8 +77,8 @@ export function uiSave(context) {
return;
numChanges = _;
tooltipBehavior.title(tooltipHtml(t(numChanges > 0 ?
'save.help' : 'save.no_changes'), key));
tooltipBehavior.title(uiTooltipHtml(
t(numChanges > 0 ? 'save.help' : 'save.no_changes'), key));
var background = getBackground(numChanges);

View File

@@ -118,8 +118,8 @@ export function utilPrefixCSSProperty(property) {
var transformProperty;
export function utilSetTransform(el, x, y, scale) {
var prop = transformProperty = transformProperty || prefixCSSProperty('Transform'),
translate = Detect().opera ?
var prop = transformProperty = transformProperty || utilPrefixCSSProperty('Transform'),
translate = utilDetect().opera ?
'translate(' + x + 'px,' + y + 'px)' :
'translate3d(' + x + 'px,' + y + 'px,0)';
return el.style(prop, translate + (scale ? ' scale(' + scale + ')' : ''));