# How to add a map using GeoServer and kibana 8.10

**URL:** https://discuss.elastic.co/t/how-to-add-a-map-using-geoserver-and-kibana-8-10/345130
**Category:** Kibana
**Tags:** maps
**Created:** [October 16, 2023, 5:55pm UTC](https://discuss.elastic.co/t/how-to-add-a-map-using-geoserver-and-kibana-8-10/345130 "2023-10-16T17:55:46Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Erez\_Danieli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erez_danieli/32/126550_2.png) [@Erez\_Danieli](https://discuss.elastic.co/u/Erez_Danieli)
#### Post date: [October 16, 2023, 5:55pm UTC](https://discuss.elastic.co/t/how-to-add-a-map-using-geoserver-and-kibana-8-10/345130/1 "2023-10-16T17:55:47Z")

</div>

Hi there Elastic team,

I'm looking for some guidance on how to add a custom map using a geoserver. I have went over the instructions on this blog [Kibana and a Custom Tile Server for NHL Data | Elastic Blog](https://www.elastic.co/blog/kibana-and-a-custom-tile-server-for-nhl-data) and and I can't make it to work. I'm using Kibana 8.10 and GeoServer 2.23. Any guidance on how to troubleshoot this?  
i think the problem is with the tile format({z}/{x}/{y}.png) that the kibana need and what the right format for the geoServer.  
I would be happy to receive help later on the attached guide, how do I add the appropriate link to Kibana  
Thank you

 ![Capture](https://us1.discourse-cdn.com/elastic/original/3X/c/4/c47d3b60986dfac61d5255c49e8a4cd38db7a3d2.jpeg)

---

<div class="post-metadata">

### Author: ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)
#### Post date: [October 16, 2023, 7:34pm UTC](https://discuss.elastic.co/t/how-to-add-a-map-using-geoserver-and-kibana-8-10/345130/2 "2023-10-16T19:34:53Z")

</div>

Hi @Erez_Danieli. It looks like you are trying to add a WMS layer from Geoserver. But you've chosen to add a "Tile Map Service" layer. Try adding a layer again, but choose the "Web Map Service" layer instead.

---

<div class="post-metadata">

### Author: ![Erez\_Danieli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erez_danieli/32/126550_2.png) [@Erez\_Danieli](https://discuss.elastic.co/u/Erez_Danieli)
#### Post date: [October 16, 2023, 10:10pm UTC](https://discuss.elastic.co/t/how-to-add-a-map-using-geoserver-and-kibana-8-10/345130/3 "2023-10-16T22:10:15Z")

</div>

Thank you very much, there is significant progress, I repeated exactly the guide again, this time with the change you mentioned("Web Map Service" layer). There is still a problem.

 ![Capture](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ae475d0d2d7a39e23c3adee39e3f559581dc656.jpeg)

I note that the geoserver  
works without a problem (test it with qgis)

 ![Capture1](https://us1.discourse-cdn.com/elastic/original/3X/2/0/20fefd9790338758275a78627fdff217a3fc6e25.jpeg)  
 ![Capture3](https://us1.discourse-cdn.com/elastic/original/3X/e/8/e874e585c3ff1b84a1bca3b55801106c59a170f3.jpeg)

maybe something with the kibana.yml?

---

<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: [October 17, 2023, 7:26am UTC](https://discuss.elastic.co/t/how-to-add-a-map-using-geoserver-and-kibana-8-10/345130/4 "2023-10-17T07:26:13Z")

</div>

You can use the browser developer tools to see the exact error you are seeing. It may be the name of the style or something different.

If you open the layer preview in the GeoServer interface using the same Web Map Service protocol (WMS), you can compare the network requests between kibana and that preview to find the difference.

Sorry for the vague answers, but without better error messaging, it is hard to know exactly what's wrong with your setup.

---

<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: [October 17, 2023, 7:56am UTC](https://discuss.elastic.co/t/how-to-add-a-map-using-geoserver-and-kibana-8-10/345130/5 "2023-10-17T07:56:10Z")

</div>

I just run the official docker image with the relevant bit of enabling CORS

```auto
$ mkdir /tmp/geoserver
$ docker run --rm --name geoserver \
  -v /tmp/geoserver:/opt/geoserver_data \
  -p 8080:8080 --env CORS_ENABLED=true \
  docker.osgeo.org/geoserver:2.23.x

```

Without any further configuration, I could add the `nl:countries` world layer to Kibana Maps just loading the WMS endpoint

```auto
http://localhost:8080/geoserver/ne/wms

```

Because the layer has a default style I don't need to select any and it just loads fine.

![Peek 2023-10-17 09-53](https://us1.discourse-cdn.com/elastic/original/3X/7/f/7f1a1296dab9140ed84351d93ccc58ebcc485236.gif)

I would recommend starting from this initial setting to test things.

---

<div class="post-metadata">

### Author: ![Erez\_Danieli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erez_danieli/32/126550_2.png) [@Erez\_Danieli](https://discuss.elastic.co/u/Erez_Danieli)
#### Post date: [October 17, 2023, 8:50am UTC](https://discuss.elastic.co/t/how-to-add-a-map-using-geoserver-and-kibana-8-10/345130/6 "2023-10-17T08:50:42Z")

</div>

Very professional answer, problem solved.  
I looked at the messages sent between the geoserver and the kibana and saw that CORS was missing, in addition to the fact that I saw that it appears in your example.  
I updated the geoserver WEB-INF on the server:  
File location:  
geoserver/webapps/geoserver/WEB-INF  
The following lines must be enabled:

```auto
   <!-- Uncomment following filter to enable CORS in Jetty. Do not forget the second config block further down. -->
	<filter>
  	<filter-name>cross-origin</filter-name>
  	<filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
  	<init-param>
    	<param-name>chainPreflight</param-name>
    	<param-value>false</param-value>
  	</init-param>
  	<init-param>
    	<param-name>allowedOrigins</param-name>
    	<param-value>*</param-value>
  	</init-param>
  	<init-param>
    	<param-name>allowedMethods</param-name>
    	<param-value>GET,POST,PUT,DELETE,HEAD,OPTIONS</param-value>
  	</init-param>
  	<init-param>
    	<param-name>allowedHeaders</param-name>
    	<param-value>*</param-value>
  	</init-param>
	</filter>

	<!-- Uncomment following filter-mapping to enable CORS -->
	<filter-mapping>
    	<filter-name>cross-origin</filter-name>
    	<url-pattern>/*</url-pattern>
	</filter-mapping>
    
   
	<filter-mapping>
  	<filter-name>FlushSafeFilter</filter-name>
  	<url-pattern>/*</url-pattern>
	</filter-mapping>
    
	<filter-mapping>
  	<filter-name>SessionDebugger</filter-name>
  	<url-pattern>/*</url-pattern>
	</filter-mapping>

	<filter-mapping>
  	<filter-name>GZIP Compression Filter</filter-name>
  	<url-pattern>/*</url-pattern>
	</filter-mapping>

	<filter-mapping>
  	<filter-name>xFrameOptionsFilter</filter-name>
  	<url-pattern>/*</url-pattern>
	</filter-mapping>

```

 ![Capture](https://us1.discourse-cdn.com/elastic/original/3X/d/1/d1a87375e9a1aad731d7d0d6595f62103a9d1511.jpeg)

Thank you

---

<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: [October 17, 2023, 9:21am UTC](https://discuss.elastic.co/t/how-to-add-a-map-using-geoserver-and-kibana-8-10/345130/7 "2023-10-17T09:21:19Z")

</div>

Glad it worked!

Definitely, the CORS setting is always a source of issues for Geoserver users, but fortunately, it's an easy one to spot and fix, and the project docs cover this very well.

Cheers!

---

<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: [November 14, 2023, 9:21am UTC](https://discuss.elastic.co/t/how-to-add-a-map-using-geoserver-and-kibana-8-10/345130/8 "2023-11-14T09:21:45Z")

</div>

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