blob: 56de937463b3f1d807e1a6f8e7e448113d79d310 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
app.views.Location = Backbone.View.extend({
el: "#location",
initialize: function(){
this.render();
this.getLocation();
},
render: function() {
$("<div class=\"loader\"><div class=\"spinner\"></div></div>").appendTo(this.el);
},
getLocation: function(){
var element = this.el ;
var locator = new OSM.Locator();
locator.getAddress(function(address, latlng){
$(element).empty();
$("<input></input>",
{ id: "location_address",
value: address,
type: "text",
class: "input-block-level form-control"
}).appendTo($(element));
$("#location_coords").val(latlng.latitude + "," + latlng.longitude);
});
}
});
// @license-end
|