如何在网页上显示在GeoServer上发布的图层组?

huangapple go评论81阅读模式
英文:

How can I display a layer group that is published on GeoServer on a webpage?

问题

我已在GeoServer中发布了三个shapefile作为图层组。现在我想在我的Web应用程序中显示该图层组。我应该如何做呢?我正在使用HTML、CSS和JavaScript。

您可以指导我完成这个过程吗?

英文:

I have published three shapefiles as a layer group in GeoServer. Now I want to display that layer group in my web application. How can I do it? I am using HTML, CSS, and javascript.

Could you please guide me through the steps to achieve this?

答案1

得分: 1

以下是翻译好的部分:

看起来你创建了一个组后发布了一个WMS图层,你可以使用Openlayers JavaScript库来实现你的目标。

首先在你的本地环境安装Openlayers的依赖项:
https://openlayers.org/doc/quickstart.html

现在你可以前往并按照OpenLayers WMS示例:
https://openlayers.org/en/latest/examples/wms-tiled.html

记得修改:

  • url: 你的GeoServer实例URL
  • LAYERS: 你的图层组标识符
  • extent: 你的图层数据和投影的范围
英文:

Looks like you have a WMS layer published once you created the group and you can use Openlayers javascript library to achieve your goal.

First install the openlayers dependencies on your local environment:
https://openlayers.org/doc/quickstart.html

Now you can go and follow the OpenLayers WMS example:
https://openlayers.org/en/latest/examples/wms-tiled.html

Remember to change:

  • url: your GeoServer instance URL
  • LAYERS: your layers group identifier
  • extent: the extent for your layer data and projection

huangapple
  • 本文由 发表于 2023年8月4日 21:14:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/76836280.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定