diff --git a/dist/recline.js b/dist/recline.js index 238ab5a4..11910563 100644 --- a/dist/recline.js +++ b/dist/recline.js @@ -2501,18 +2501,18 @@ my.Map = Backbone.View.extend({ // Listen to changes in the fields this.model.fields.bind('change', function() { - self._setupGeometryField() - self.render() + self._setupGeometryField(); + self.render(); }); // Listen to changes in the records - this.model.records.bind('add', function(doc){self.redraw('add',doc)}); + this.model.records.bind('add', function(doc){self.redraw('add',doc);}); this.model.records.bind('change', function(doc){ self.redraw('remove',doc); self.redraw('add',doc); }); - this.model.records.bind('remove', function(doc){self.redraw('remove',doc)}); - this.model.records.bind('reset', function(){self.redraw('reset')}); + this.model.records.bind('remove', function(doc){self.redraw('remove',doc);}); + this.model.records.bind('reset', function(){self.redraw('reset');}); this.menu = new my.MapMenu({ model: this.model, @@ -2612,7 +2612,7 @@ my.Map = Backbone.View.extend({ var count = 0; var wrongSoFar = 0; - _.every(docs,function(doc){ + _.every(docs, function(doc){ count += 1; var feature = self._getGeometryFromRecord(doc); if (typeof feature === 'undefined' || feature === null){ @@ -2621,7 +2621,7 @@ my.Map = Backbone.View.extend({ } else if (feature instanceof Object){ // Build popup contents // TODO: mustache? - html = '' + html = ''; for (key in doc.attributes){ if (!(self.state.get('geomField') && key == self.state.get('geomField'))){ html += '
';
- var bg = new L.TileLayer(mapUrl, {maxZoom: 18, attribution: osmAttribution, subdomains: '1234'});
+ var bg = new L.TileLayer(mapUrl, {maxZoom: 18, attribution: osmAttribution ,subdomains: '1234'});
this.map.addLayer(bg);
this.features = new L.GeoJSON();
- this.features.on('featureparse', function (e) {
- if (e.properties && e.properties.popupContent){
- e.layer.bindPopup(e.properties.popupContent);
- }
- if (e.properties && e.properties.cid){
- e.layer.cid = e.properties.cid;
- }
- });
-
- // This will be available in the next Leaflet stable release.
- // In the meantime we add it manually to our layer.
- this.features.getBounds = function(){
- var bounds = new L.LatLngBounds();
- this._iterateLayers(function (layer) {
- if (layer instanceof L.Marker){
- bounds.extend(layer.getLatLng());
- } else {
- if (layer.getBounds){
- bounds.extend(layer.getBounds().getNorthEast());
- bounds.extend(layer.getBounds().getSouthWest());
- }
- }
- }, this);
- return (typeof bounds.getNorthEast() !== 'undefined') ? bounds : null;
- }
-
this.map.addLayer(this.features);
- this.map.setView(new L.LatLng(0, 0), 2);
+ this.map.setView([0, 0], 2);
this.mapReady = true;
},
@@ -3111,8 +3089,9 @@ my.MultiView = Backbone.View.extend({
\
\
\
@@ -3142,28 +3121,28 @@ my.MultiView = Backbone.View.extend({
view: new my.SlickGrid({
model: this.model,
state: this.state.get('view-grid')
- }),
+ })
}, {
id: 'graph',
label: 'Graph',
view: new my.Graph({
model: this.model,
state: this.state.get('view-graph')
- }),
+ })
}, {
id: 'map',
label: 'Map',
view: new my.Map({
model: this.model,
state: this.state.get('view-map')
- }),
+ })
}, {
id: 'timeline',
label: 'Timeline',
view: new my.Timeline({
model: this.model,
state: this.state.get('view-timeline')
- }),
+ })
}, {
id: 'transform',
label: 'Transform',
@@ -3246,6 +3225,7 @@ my.MultiView = Backbone.View.extend({
render: function() {
var tmplData = this.model.toTemplateJSON();
tmplData.views = this.pageViews;
+ tmplData.sidebarViews = this.sidebarViews;
var template = Mustache.render(this.template, tmplData);
$(this.el).html(template);
@@ -3265,7 +3245,7 @@ my.MultiView = Backbone.View.extend({
_.each(this.sidebarViews, function(view) {
this['$'+view.id] = view.view.el;
$dataSidebar.append(view.view.el);
- });
+ }, this);
var pager = new recline.View.Pager({
model: this.model.queryState
@@ -3308,13 +3288,7 @@ my.MultiView = Backbone.View.extend({
_onMenuClick: function(e) {
e.preventDefault();
var action = $(e.target).attr('data-action');
- if (action === 'filters') {
- this.$filterEditor.toggle();
- } else if (action === 'fields') {
- this.$fieldsView.toggle();
- } else if (action === 'transform') {
- this.transformView.el.toggle();
- }
+ this['$'+action].toggle();
},
_onSwitchView: function(e) {
@@ -3379,7 +3353,7 @@ my.MultiView = Backbone.View.extend({
var self = this;
_.each(this.pageViews, function(pageView) {
pageView.view.bind('recline:flash', function(flash) {
- self.notify(flash);
+ self.notify(flash);
});
});
},
@@ -3401,14 +3375,15 @@ my.MultiView = Backbone.View.extend({
},
flash
);
+ var _template;
if (tmplData.loader) {
- var _template = ' \
+ _template = ' \