Merge pull request #3061 from simianhacker/fix/3041

Closes #3041 - Link geo point visualize fields to a tile map vis
This commit is contained in:
Rashid Khan 2015-02-17 16:09:18 -07:00
commit 84ff35e65f

View file

@ -117,6 +117,7 @@ define(function (require) {
$scope.runAgg = function (field) {
var agg = {};
var type = 'histogram';
// If we're visualizing a date field, and our index is time based (and thus has a time filter),
// then run a date histogram
if (field.type === 'date' && $scope.indexPattern.timeFieldName) {
@ -128,6 +129,17 @@ define(function (require) {
interval: 'auto'
}
};
} else if (field.type === 'geo_point') {
type = 'tile_map';
agg = {
type: 'geohash_grid',
schema: 'segment',
params: {
field: field.name,
percision: 3
}
};
} else {
agg = {
type: 'terms',
@ -141,7 +153,7 @@ define(function (require) {
$location.path('/visualize/create').search({
indexPattern: $scope.state.index,
type: 'histogram',
type: type,
_a: rison.encode({
filters: $scope.state.filters || [],
query: $scope.state.query || undefined,