[view/map] Don't show GeoJSON geometries in the popup as they can be quite big
This commit is contained in:
@@ -293,7 +293,9 @@ my.Map = Backbone.View.extend({
|
|||||||
// TODO: mustache?
|
// TODO: mustache?
|
||||||
html = ''
|
html = ''
|
||||||
for (key in doc.attributes){
|
for (key in doc.attributes){
|
||||||
html += '<div><strong>' + key + '</strong>: '+ doc.attributes[key] + '</div>'
|
if (!(self.state.get('geomField') && key == self.state.get('geomField'))){
|
||||||
|
html += '<div><strong>' + key + '</strong>: '+ doc.attributes[key] + '</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
feature.properties = {popupContent: html};
|
feature.properties = {popupContent: html};
|
||||||
|
|
||||||
|
|||||||
@@ -111,8 +111,11 @@ test('Popup', function () {
|
|||||||
assertPresent(popup);
|
assertPresent(popup);
|
||||||
|
|
||||||
var text = popup.text();
|
var text = popup.text();
|
||||||
|
ok((text.indexOf('geom') === -1))
|
||||||
_.each(view.model.fields.toJSON(),function(field){
|
_.each(view.model.fields.toJSON(),function(field){
|
||||||
ok((text.indexOf(field.id) !== -1))
|
if (field.id != 'geom'){
|
||||||
|
ok((text.indexOf(field.id) !== -1))
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
view.remove();
|
view.remove();
|
||||||
|
|||||||
Reference in New Issue
Block a user