mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 17:23:02 +00:00
Hook up connection and history in context
This commit is contained in:
@@ -16,6 +16,10 @@ window.iD = function () {
|
||||
// the connection requires .storage() to be available on calling.
|
||||
var connection = iD.Connection(context);
|
||||
|
||||
connection.on('load.context', function (err, result) {
|
||||
history.merge(result);
|
||||
});
|
||||
|
||||
/* Straight accessors. Avoid using these if you can. */
|
||||
context.ui = function() { return ui; };
|
||||
context.connection = function() { return connection; };
|
||||
|
||||
@@ -26,9 +26,6 @@ iD.Map = function(context) {
|
||||
surface, tilegroup;
|
||||
|
||||
function map(selection) {
|
||||
context.connection()
|
||||
.on('load.tile', connectionLoad);
|
||||
|
||||
context.history()
|
||||
.on('change.map', redraw);
|
||||
|
||||
@@ -100,10 +97,6 @@ iD.Map = function(context) {
|
||||
surface.selectAll('.layer *').remove();
|
||||
}
|
||||
|
||||
function connectionLoad(err, result) {
|
||||
context.history().merge(result);
|
||||
}
|
||||
|
||||
function zoomPan() {
|
||||
if (d3.event && d3.event.sourceEvent.type === 'dblclick') {
|
||||
if (!dblclickEnabled) {
|
||||
|
||||
Reference in New Issue
Block a user