Skip to content

Commit

Permalink
Merge f03a31c into df8611d
Browse files Browse the repository at this point in the history
  • Loading branch information
jdungan committed Sep 7, 2014
2 parents df8611d + f03a31c commit 2019196
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 36 deletions.
64 changes: 29 additions & 35 deletions bpz/static/js/bpz.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,44 @@
var call_map, bpz, value, _fn, _i, _len;



//TODO: replace
function Location() {
var options = {
enableHighAccuracy: true
},
dfd = new $.Deferred(),
inner_pos = {}
moved = function(pos) {
inner_pos = pos || {};
dfd.resolve(this)
},
fail = function(err) {
if (err) {
console.warn('ERROR(' + err.code + '): ' + err.message);
}
dfd.reject()
};
var dfd = new $.Deferred(),
_pos ={},
options = {
enableHighAccuracy: true
},
fail = function(err) {
if (err) {
console.warn('ERROR(' + err.code + '): ' + err.message);
}
dfd.reject()
};

this.__defineGetter__("lat", function() {
return inner_pos.coords ? inner_pos.coords.latitude : null;
});
Object.defineProperty(this, "lat", {
get: function() {return _pos.coords ? _pos.coords.latitude : null; }
})

this.__defineGetter__("lng", function() {
return inner_pos.coords ? inner_pos.coords.longitude : null;
});
Object.defineProperty(this, "lng", {
get: function() {return _pos.coords ? _pos.coords.longitude : null; }
})

this.__defineGetter__("pos", function() {
return {
lng: this.lng,
lat: this.lat
};
});
this.position = inner_pos;
Object.defineProperty(this, "pos", {
get: function() {
return { lng: _pos.coords.longitude, lat: _pos.coords.latitude};
},
set: function(new_pos){
_pos = new_pos
dfd.resolve(this)
}
})

this.WatchID = navigator.geolocation.watchPosition(moved, fail, options);
pos_desc = Object.getOwnPropertyDescriptor(this, 'pos');

this.WatchID = navigator.geolocation.watchPosition(pos_desc.set, fail, options);

this.ready = dfd.promise()

}



bpz = {
_map:false,
api: {},
Expand Down Expand Up @@ -77,7 +72,6 @@ bpz = {
d3.select("#map-canvas").classed("active",true)
bpz.location.ready.done(function (d) {
bpz.map.setView(bpz.location.pos,16)

})
},
layers: {
Expand Down
6 changes: 5 additions & 1 deletion bpz/templates/bpz/address.jinja2
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{% extends "bpz/base.jinja2" %}


{% endblock %}
{% block body_container -%}
<div class="container">
<p> ADDRESS FORM HERE</p>
</div>
{% endblock body_container %}
5 changes: 5 additions & 0 deletions bpz/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
url(r'^notify',
TemplateView.as_view(template_name='bpz/notify.jinja2'),
name='notify'),
url(r'^address',
TemplateView.as_view(template_name='bpz/address.jinja2'),
name='address'),


url(r'^cases', cases, name='cases'),
url(r'^hoa', hoa, name='home_owners'),

Expand Down

0 comments on commit 2019196

Please sign in to comment.