Region Map not showing

Ya, I know there is a few questions related to custom GeoJSON file not loading etc...But my situation is a bit weird...

I attempted my own GeoJSON file but can't get it to show as an option at the Vector Map field in Region Map. After some numerous failed attempt, I decided to try on the sample in the blog which is the Australian map.

So, current ES ver. is 7.5, same goes for Kibana. Below is my config in kibana.yml:

   map.regionmap:
   includeElasticMapsService: false
   layers:
      - name: "Australian States"
        url: "http://xx.xx.xx.xx:8000/aus_state.geojson"
        attribution: "https://exploratory.io/maps"
        fields:
           - name: "STATE_NAME"
             description: "State Name"

I'm using http-server to host the GeoJSON file that I downloaded.

Here is the thing:

  1. NO CORS ERROR recorded.
  2. Can download the mapfile just fine during Kibana Region Map loading, status 200.

Data load fine too, but still No option shows under Vendor Map field...

Desperately need some help here...

This is a common question. One possible answer may be here.

I tried.

In fact both http-server --cors='' -p 8000* and http-server --cors="kbn-version" -p 8000 give the same behavior, in which if I use Developer Tools in browser, I can see the GeoJSON file successfully downloaded, just won't show as an option...

Below is the screenshot:

Whereby if I close the hosting server, Kibana shows this error:

Hence I deduce that most probably is not CORS error anymore, but something else, but I just not sure what...

Is there a possibility of a bug in Kibana itself? As this phenomenon did lodged before in Github:

Region map vector map list empty in v5.5.2

Even though the issues is closed, it maybe happen again?

Hi @zidane28. Sorry, I am unable to recreate the issue in 7.5.

Here are some things to check.

  1. Every name parameter in the fields array in your configuration must exist as properties in the GeoJSON file.
  2. Your GeoJSON file must have entirely polygon or multipolygon features.

Is it possible to share your configuration? The configuration you shared in the first post must be configured to your dataset. That is merely an example.

Here is an example where I configured my Kibana to show a self-hosted GeoJSON file that I downloaded from here.

map.regionmap:
      layers:
       - name: "self-hosted boundary"
         attribution: "osm"
         url: "http://localhost:5555/denmark_regions_v1.geo.json"
         fields:
          - name: "iso_3166_2"
            description: "ISO 3166-2"
          - name: "label_en"
            description: "label"
  1. For the example mapfiles, which is Australia States in this case, there is a properties named STATE_NAME, in this case same with the 'name' parameter as you said.
  2. Well, I downloaded the mapfile from Maps, as per in the blog, so I can assume the mapfile have the polygon or multipolygon features.

I originally setup our own mapfiles, but it doesn't work, hence I use the example in the blog instead, because I want to troubleshoot to see what is the cause, if the example works, then most probably is our own map file at fault, but now...Even example provided in the blog not working as well...

Hence my config is almost the same as in the blog post (almost is due to some config changes between ver 6 and 7)

May I know what web server you are using? I'm currently using http-server as per the blog suggests.

I had attempted as well the mapfile from your reply, the denmark map, still the same issue.

map.regionmap:
includeElasticMapsService: false
layers:
   - name: "self-hosted boundary"
     url: "http://10.20.53.59:8000/denmark.geo.json"
     attribution: "osm"
     fields:
        - name: "label_en"
          description: "Label"

I change the mapfile name as it is too long.

Hi @zidane28,

I used http-server as well. Specifically this command from the directory where I downloaded the file.

npx http-server --port 5555 --cors="kbn-verson"

Can you share specifically which version of 7.5 you are running? 7.5.0 or 7.5.1? I am running 7.5.1.

I first use ver.7.5.0, have this same prob, then I upgrade to 7.5.1, then still same problem...

I had use the same line of command as per your reply, I even change the port number to match yours, but the prob still persists...Below is the screenshot of my http-server:

Just so u know, I hosted the http-server on the same machine as ES + Kibana. Weird thing is, somehow Kibana can't detect localhost or 127.0.0.1, it must use the IP of the server itself. Originally I set the http-server on another server, but it doesn't work so I switched for hosting the mapfile on the same server as Kibana, but I don't think this is the cause of the issue...

Below is my kibana.yml config, minus some confidential info:

server.port: 5601
server.host: "0"
server.name: "Kibana ver.7"

logging.dest: /var/log/kibana/kibana.log

xpack.monitoring.ui.container.elasticsearch.enabled: true
elasticsearch.username: "<>"
elasticsearch.password: "<>"

map.regionmap:
   includeElasticMapsService: false
   layers:
      - name: "self-hosted boundary"
        url: "http://10.20.53.59:5555/denmark.geo.json"
        attribution: "osm"
        fields:
           - name: "label_en"
             description: "Label"

server.cors: true
server.cors.origin: ['*']

Problem same means no error on downloading the map, no error on console message other than:
Kibana Console Message

From the tones of yours, it sounds like your Kibana don't have this issues, so why mine have... :cry:

Or, there is some extra steps that I had missed? Meaning for example adding custom map config in Kibana.yml alone is not enough?

Any help here...? :cry:

Apologies. I'm still checking on this. Please don't despair. We will figure it out.

Thanks...

One thing kinda interesting is that, my colleague, who testing using ES Docker manage to get it work as intended...Hosted on local docker, Windows 10 machine.

While I try another diff approach in which I download both ES and Kibana zip, host on my local machine, Windows 10 as well, host http-server on my local as well, still same problem...

Update: My manager tried on its Mac machine, docker Kibana, same problem.

Can you tell me whether you are using the open source or the default distribution of Kibana. If you are using the default distribution, can you add your file in the Elastic Maps application? It should be available in the Add Layer menu under "Configured GeoJSON".

  1. Default distribution of Kibana
  2. Yes, I can add the file in Elastic Map application.

But I still can't generate region map from it?

Hi @zidane28, today @nickpeihl is out of the office but I've looked into your case and I can say that I can't reproduce your issue, but let me share more details because I see a small difference in the configuration for Kibana.

First I downloaded the World Countries dataset from Elastic Map Service and started seving it locally using the same http-server web server Nick mentioned earlier with CORS enabled:

$ curl --compressed https://vector.maps.elastic.co/files/world_countries_v1.geo.json \
  > world_countries_v1.geo.json
$ npx http-server -p 8085 --cors="kbn-version" .

Then I started an almost zero configuration Elasticsearch docker cluster:

$ docker run --rm --network host \
  -e "discovery.type=single-node" \
  docker.elastic.co/elasticsearch/elasticsearch:7.5.1

rm will remove the image when it's closed and network host allows to expose the image ports as if they were run by localhost.

Then I used this configuration kibana.yml:

map:
    includeElasticMapsService: false
    tilemap:
        options:
            maxZoom: 18
            attribution: Stamen
        url: http://a.tile.stamen.com/watercolor/{z}/{x}/{y}.png
    regionmap:
        layers:
        - name: "World Borders"
            attribution: "osm"
            url: "http://localhost:8085/world_countries_v1.geo.json"
            fields:
            - name: "iso3"
                description: "ISO3"
            - name: "iso2"
                description: "ISO2"
            - name: "name"
                description: "label"
        - name: "Denmark"
            attribution: "osm"
            url: "http://localhost:8085/denmark_regions_v1.geo.json"
            fields:
            - name: "iso_3166_2"
                description: "ISO 3166-2"
            - name: "label_en"
                description: "label"

Finally started another temporal Docker image that uses this config:

$ docker run --rm --network host \
  -v "$(pwd)/kibana.yml:/usr/share/kibana/config/kibana.yml" \
  docker.elastic.co/kibana/kibana:7.5.1

With this fresh installation, I could add the example flights data to have some data with a join field available and create a Region map that offers both custom layers on top of the custom base map.

From your last configuration what I see is that maybe you are not disabling EMS correctly because you placed the key under regionmap instead of under map.

To confirm this, you can see that you have effectively removed EMS if your region map or the Maps application does not show any basemap at all unless you configure map.tilemap.url as I shared. Without the tilemap section you should see something like this:

I tried this configuration running 7.4.2, 7.5.0, and 7.5.1 on the Docker commands and it always run correctly.

Let us know if this helps.

Thanks! Thanks! And Thanks!

You are correct on this: maybe you are not disabling EMS correctly because you placed the key under regionmap instead of under map .

After I made some changes on the Kibana.yml according to your config, it works!

I had marked your reply as solution, thank you so much for the help!

1 Like

Awesome!

@zidane28 sorry because this is actually a documentation error we have here that confused you.

https://www.elastic.co/guide/en/kibana/current/settings.html#regionmap-settings

we will fix this ASAP

cc. @thomasneirynck

1 Like

LOL! No prob~

Better fix it fast before other people ask this same question again haha~

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