# Using a layer as a filter in a map

**URL:** https://discuss.elastic.co/t/using-a-layer-as-a-filter-in-a-map/248588
**Category:** Kibana
**Created:** [September 14, 2020, 10:31pm UTC](https://discuss.elastic.co/t/using-a-layer-as-a-filter-in-a-map/248588 "2020-09-14T22:31:14Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Vester](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vester/32/81160_2.png) [@Vester](https://discuss.elastic.co/u/Vester)
#### Post date: [September 14, 2020, 10:31pm UTC](https://discuss.elastic.co/t/using-a-layer-as-a-filter-in-a-map/248588/1 "2020-09-14T22:31:14Z")

</div>

Hi,

Is it possible to use a layer imported from a GeoJSON file as a filter ? Example, in this picture I would like to use the red area layer as a filter, only points inside the area are shown ?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/3/f33baf69bb03476ad7eb7664b849aa7844fb6bbb.jpeg)

How can I do it ?

thanks,

---

<div class="post-metadata">

### Author: ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)
#### Post date: [September 15, 2020, 11:24am UTC](https://discuss.elastic.co/t/using-a-layer-as-a-filter-in-a-map/248588/2 "2020-09-15T11:24:18Z")

</div>

At this moment you cannot perform overlay analysis with Kibana. If you are only talking about a single feature, you can still add the coordinates of that feature to the Map filter. The trick (and we may need to improve this) is that the interface is in the tooltip, and it will only show if you add at least one field.

My test:

- Add the Kibana Flights sample data
- Create a map with a `Documents` layer from the Kibana Flights index, mapping the `OriginLocation` field.
- Increase the main Kibana time range to render enough data
- Import a sample GeoJSON file and uncheck the `Apply global filter to layer data`
- Add the `_id` field (or any other) to the GeoJSON layer
- Click on the feature and then on `Filter by geometry`. On the small following wizard remember to set up the filtered field as `OriginLocation`, since that's the field of your points.

 ![Peek 2020-09-15 13-22](https://us1.discourse-cdn.com/elastic/original/3X/4/8/4804b6ef0b796117f2b23c4ad529bfc56c632a7a.gif)

Hope this helps.

---

<div class="post-metadata">

### Author: ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)
#### Post date: [September 15, 2020, 11:40am UTC](https://discuss.elastic.co/t/using-a-layer-as-a-filter-in-a-map/248588/3 "2020-09-15T11:40:39Z")

</div>

Created a feature request [here](https://github.com/elastic/kibana/issues/77463) related with the need for a tooltip to appear to have at least one field added.

> <https://github.com/elastic/kibana/issues/77463>
>
> Describe the feature:
> At this moment the Elastic Maps tooltip is serving the purpose of:
> Allowing to filter by field value
> Giving access to...

---

<div class="post-metadata">

### Author: ![Vester](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vester/32/81160_2.png) [@Vester](https://discuss.elastic.co/u/Vester)
#### Post date: [September 15, 2020, 2:06pm UTC](https://discuss.elastic.co/t/using-a-layer-as-a-filter-in-a-map/248588/4 "2020-09-15T14:06:21Z")

</div>

Hi Jorge,

Thanks a lot for your answer. I tested your solution and will do it.  
And thanks for the new feature request it will be useful.

thanks,

---

<div class="post-metadata">

### Author: ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)
#### Post date: [September 15, 2020, 2:15pm UTC](https://discuss.elastic.co/t/using-a-layer-as-a-filter-in-a-map/248588/5 "2020-09-15T14:15:48Z")

</div>

Great, feel free to add any comments to the feature request.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [October 13, 2020, 2:16pm UTC](https://discuss.elastic.co/t/using-a-layer-as-a-filter-in-a-map/248588/6 "2020-10-13T14:16:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
