Geopoint on Region Map

Is it possible to plot geopoints and highlight regions in the same map? I would like to build a map that shows both our facility locations and highlight our customer zip codes. I can already do both of of these things in separate visualizations but It would be nice to show a more complete picture if I could somehow do both within the same visualization.

@naknak987

This is possible with the Maps app in Kibana. Each one (zip code + points) will be a separate layer on a single map. See https://www.elastic.co/guide/en/kibana/current/maps.html and https://www.elastic.co/blog/elastic-maps-beta-released to get started.

@thomasneirynck
The second link is broken. After looking through the maps documentation I was able to to get our facility locations to plot on the map and I was able to add the zip code vector. I'm still not able to figure out how to make it just highlight the zip codes from the data in the index. It highlights the whole US instead, even after setting the "term joins".

I should mention that the facility location geopoint coordinates and our customer zipcode data are in separate indices. I'm not sure if that would affect this.

hi @naknak987,

I fixed the link, thanks for flagging.

The data being in different indices is fine. That behavior you are looking for (only highlighting the zip-codes that match the data) will be available in the next version of Kibana. https://github.com/elastic/kibana/pull/36617 .

@thomasneirynck
Thank you for being so responsive. It also appears that the term join is not working correctly. I have it set to join on the zip code using the count metric but I don't see any count when I hover over zip codes that should have a count. This works fine on the 'Region Map' visualization. Do I need to have a timestamp with my data? That's the only thing I can think of that might be throwing this off as I don't have any timestamps with either index.

UPDATE: I've added a date field and re-indexed the customer data just to see if it would make a difference and it didn't.

@naknak987

Hmmm.... that should not be the case.

Can you isolate this issue and post a step-by-step to reproduce this? If this is not working, than that is definitely a bug and it should be logged here: https://github.com/elastic/kibana/issues/new

@thomasneirynck
I'm running version 7.2.0 on Windows 10. My zip code data looks like this.
Capture

Here is how I setup the Map app with the joins and style.
Capture

As you can see, it's not working. Its outlining the different zip codes but its not matching any data from my index so nothing is being styled.

Here it is working in 'Region Map' visualization. This is what I want that layer from above to do.
Capture

Do you still think this is a bug?

ok thanks.

It might have to do with the formatting or data format of the zip-code field. It looks to be a number field, instead of a string.

Can you show me the mapping of that index-pattern? Also, does the ZipCode field have a field-formatter associated with it?

@thomasneirynck
The mapping is as fallows.

PUT zips
{
  "mappings" : {
    "properties" : {
      "FacZipCode" : {
        "type" : "integer"
      },
      "ID" : {
        "type" : "integer"
      },
      "ZipCode" : {
        "type" : "integer"
      },
      "facname" : {
        "type" : "keyword"
      },
      "status" : {
        "type" : "keyword"
      }
    }
  },
  "settings" : {
    "index" : {
      "number_of_shards" : "1",
      "number_of_replicas" : "0"
    }
  }
} 

Here is the index pattern.

I've tried it with the 'ZipCode' field without formatting, formatted as a number without any decimals or commas and formatted as a string. Nothing seems to work. Maybe I need to index the data as a string to begin with?

UPDATE: Setting the 'ZipCode' field to the keyword type fixed the issue.

Why would the 'Region Map' visualization work with the 'ZipCode' field set to the integer type but not the Map app?

1 Like

thanks for flagging @naknak987 and providing a work-around.

After investigation, this is a bug. I logged it here https://github.com/elastic/kibana/issues/41491

We will need to fix this. Please keep posted, thanks