mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-01 17:03:42 +00:00
Clean up
This commit is contained in:
@@ -22,9 +22,12 @@ iD.GpxLayer = function(context, dispatch) {
|
||||
.append('path')
|
||||
.attr('class', 'gpx');
|
||||
|
||||
var path = d3.geo.path()
|
||||
.projection(projection);
|
||||
|
||||
paths
|
||||
.attr('d', d3.geo.path().projection(projection));
|
||||
|
||||
.attr('d', path);
|
||||
|
||||
if (typeof gj.features !== 'undefined') {
|
||||
svg
|
||||
.selectAll('text')
|
||||
@@ -33,21 +36,19 @@ iD.GpxLayer = function(context, dispatch) {
|
||||
svg
|
||||
.selectAll('path')
|
||||
.data(gj.features)
|
||||
.enter()
|
||||
.enter()
|
||||
.append('text')
|
||||
.attr('class', 'gpx')
|
||||
.text(function(d) {
|
||||
return d.properties.name;
|
||||
})
|
||||
.attr('x', function(d) {
|
||||
var centroid = d3.geo.path().projection(projection)
|
||||
.centroid(d);
|
||||
return centroid[0] + 5;
|
||||
var centroid = path.centroid(d);
|
||||
return centroid[0] + 5;
|
||||
})
|
||||
.attr('y', function(d) {
|
||||
var centroid = d3.geo.path().projection(projection)
|
||||
.centroid(d);
|
||||
return centroid[1];
|
||||
var centroid = path.centroid(d);
|
||||
return centroid[1];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user