Skip to content

Commit

Permalink
[Maps] fix tooltips for geojson source (#51251)
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese authored Nov 21, 2019
1 parent 345ce4d commit e6404cb
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import React from 'react';
import {
ES_GEO_FIELD_TYPE,
GEOJSON_FILE,
ES_SIZE_LIMIT
ES_SIZE_LIMIT,
FEATURE_ID_PROPERTY_NAME
} from '../../../../common/constants';
import { ClientFileCreateSourceEditor } from './create_client_file_source_editor';
import { ESSearchSource } from '../es_search_source';
Expand Down Expand Up @@ -136,12 +137,16 @@ export class GeojsonFileSource extends AbstractVectorSource {
}

async getGeoJsonWithMeta() {
const copiedPropsFeatures = this._descriptor.__featureCollection.features
.map(feature => ({
const copiedPropsFeatures = this._descriptor.__featureCollection.features.map((feature, index) => {
const properties = feature.properties ? { ...feature.properties } : {};
properties[FEATURE_ID_PROPERTY_NAME] = index;
return {
type: 'Feature',
geometry: feature.geometry,
properties: feature.properties ? { ...feature.properties } : {}
}));
properties,
};
});

return {
data: {
type: 'FeatureCollection',
Expand Down

0 comments on commit e6404cb

Please sign in to comment.