mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-24 00:54:03 +02:00
Remove jQuery dependency more
This commit is contained in:
+9
-12
@@ -90,21 +90,18 @@
|
||||
map.controller.setState(new iD.controller.shape.NoSelection());
|
||||
});
|
||||
|
||||
function grid(resp) {
|
||||
map.setCentre({
|
||||
lon: resp.results[0][0].lon,
|
||||
lat: resp.results[0][0].lat
|
||||
});
|
||||
}
|
||||
d3.select('#geocode-form').on('submit', function() {
|
||||
d3.event.preventDefault();
|
||||
var val = d3.select('#geocode-location').node().value;
|
||||
$.ajax({
|
||||
url: 'http://api.tiles.mapbox.com/v3/mapbox/geocode/' +
|
||||
encodeURIComponent(val) + '.jsonp',
|
||||
dataType: 'jsonp',
|
||||
jsonpCallback: 'grid',
|
||||
success: function(resp) {
|
||||
map.setCentre({
|
||||
lon: resp.results[0][0].lon,
|
||||
lat: resp.results[0][0].lat
|
||||
});
|
||||
}
|
||||
});
|
||||
var scr = document.body.appendChild(document.createElement('script'));
|
||||
scr.src = 'http://api.tiles.mapbox.com/v3/mapbox/geocode/' +
|
||||
encodeURIComponent(val) + '.jsonp?callback=grid';
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
@@ -28,7 +28,7 @@ define(['dojo/_base/declare', 'iD/actions/UndoableAction'],
|
||||
if (this.newNode === null) {
|
||||
this.newNode = this.connection.doCreateNode(this.tags,
|
||||
this.lat, this.lon,
|
||||
_.bind(this.push, this));
|
||||
this.push.bind(this));
|
||||
}
|
||||
this.connection.registerPOI(this.newNode);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user