mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-24 00:54:03 +02:00
d3 naming convention
This commit is contained in:
+1
-1
@@ -130,7 +130,7 @@ var iD = function(container) {
|
||||
});
|
||||
|
||||
window.onresize = function() {
|
||||
map.setSize(m.size());
|
||||
map.size(m.size());
|
||||
};
|
||||
|
||||
d3.select(document).on('keydown', function() {
|
||||
|
||||
@@ -256,7 +256,7 @@ iD.Map = function(elem, connection) {
|
||||
.selectAll('#clip-rect')
|
||||
.size(dimensions);
|
||||
|
||||
tileclient.setSize(dimensions);
|
||||
tileclient.size(dimensions);
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -523,7 +523,7 @@ iD.Map = function(elem, connection) {
|
||||
map.zoomOut = zoomOut;
|
||||
|
||||
map.projection = projection;
|
||||
map.setSize = setSize;
|
||||
map.size = setSize;
|
||||
|
||||
map.surface = surface;
|
||||
|
||||
|
||||
@@ -48,11 +48,11 @@ iD.Tiles = function(selection, projection) {
|
||||
.attr("y", function(d) { return d[1]; });
|
||||
}
|
||||
|
||||
function setSize(x) {
|
||||
tile.size(x);
|
||||
t.size = function(size) {
|
||||
tile.size(size);
|
||||
redraw();
|
||||
return t;
|
||||
}
|
||||
};
|
||||
|
||||
t.template = function(x) {
|
||||
if (!arguments.length) return template;
|
||||
@@ -61,7 +61,6 @@ iD.Tiles = function(selection, projection) {
|
||||
return t;
|
||||
};
|
||||
|
||||
t.setSize = setSize;
|
||||
t.redraw = redraw;
|
||||
|
||||
return t;
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ describe('Map', function() {
|
||||
|
||||
describe('#getExtent', function() {
|
||||
it('reports extent', function() {
|
||||
expect(map.setSize([100, 100])).toEqual(map);
|
||||
expect(map.size([100, 100])).toEqual(map);
|
||||
expect(map.center([0, 0])).toEqual(map);
|
||||
expect(map.getExtent()[0][0]).toBeCloseTo(-36);
|
||||
expect(map.getExtent()[1][0]).toBeCloseTo(36);
|
||||
|
||||
Reference in New Issue
Block a user