简体   繁体   English

Geoserver将空矢量图块发送到Openlayers

[英]Geoserver sending empty vector tiles to Openlayers

I have setup a geoserver with Postgres/PostGIS data store and enabled the geoserver vectortiles plugin. 我已经使用Postgres / PostGIS数据存储设置了一个地理服务器,并启用了地理服务器vectortiles插件。 After loading up layers in the geoserver, the maps can be seen using the Openlayers interface provided by geoserver portal. 在Geoserver中加载图层后,可以使用geoserver门户提供的Openlayers界面查看地图。 Following this, I have been trying to get these tiles to render on front-end using a Openlayers, following the tutorial here . 在此之后,我一直在按照此处的教程,尝试使用Openlayers在前端渲染这些图块。

The code works like charm for the sample world map data given with the tutorial but while trying to render any other map layer that I have in Postgres data store, it shows up blank. 对于本教程提供的示例世界地图数据,代码的工作方式就像魅力一样,但是在尝试渲染Postgres数据存储区中的其他任何地图图层时,它显示为空白。

My data in confined to a small region (country India) rather than the whole world and uses the projection system 'EPSG:4326'. 我的数据仅限于一个较小的区域(印度),而不是整个世界,并使用“ EPSG:4326”投影系统。 The only changes made in the tutorial code is the layer name and projection_epsg_no. 教程代码中所做的唯一更改是图层名称和projection_epsg_no。

The requests being made to geoserver return an empty response (no errors). 向geoserver发出的请求返回空响应(无错误)。 This is the request URL: http://localhost:8080/geoserver/gwc/service/tms/1.0.0/layer_name@EPSG:4326@pbf/0/0/0.pbf 这是请求URL: http:// localhost:8080/geoserver/gwc/service/tms/1.0.0/layer_name@EPSG:4326@pbf/0/0/0.pbf

I had the same problem. 我有同样的问题。 In seeking the solution I arrived at this question. 在寻求解决方案时,我遇到了这个问题。 As I found (perhaps) the solution, I share it. 当我找到(也许)解决方案时,我会分享它。 If you change the projection_epsg_no, you must enter a value of EPSG present in the tiling grids of your Geoserver. 如果更改projection_epsg_no,则必须输入Geoserver的切片网格中存在的EPSG值。 By default there are only the projections 4326 and 900913. The last is compatible with the EPSG 3857. If you enter another projection, you must, beforehand, create the corresponding tiling grid in your Geoserver. 默认情况下,只有投影4326和900913。最后一个与EPSG 3857兼容。如果输入另一个投影,则必须事先在Geoserver中创建相应的切片网格。 Once done, do not forget to modify center: [0,0] to enter a value included in the range of your tiles. 完成后,别忘了修改中心:[0,0]输入包含在图块范围内的值。 Otherwise, you will not have tiles displayed. 否则,您将不会显示图块。 I hope this answer will be helpful 我希望这个答案会有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM