Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What do Cesium load Geoserver published layers look like

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you what the layer of Cesium loading Geoserver is like, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

Publish images or vector data to slice layers in geoserver and load layers in Cesium.

In the Tile Layers menu in geoserver, you can see the slice layers currently published in geoserver.

For the newly published layer, you need to edit the layer on the layer editing page, switch the Tile Caching page, and publish the slice layer.

Geoserver defines two slicing methods by default: wgs84 and web Mercator. Other slicing methods are needed, and you need to define and implement them yourself.

Use the tms service published by geoserver to load the sliced map in Cesium. The basic tms access address of geoserver is: http:// address: Port number / geoserver/gwc/service/tms/1.0.0 followed by layer name, method of slicing and format of slicing.

Code loaded as a template in Cesium is loaded using web Mercator slices by default:

Var _ baselayer = new Cesium.UrlTemplateImageryProvider ({

Url: "http://localhost:8001/geoserver/gwc/service/tms/1.0.0/topp%3Astates@EPSG%3A900913@png/{z}/{x}/{reverseY}.png",

EnablePickFeatures: false

});

Viewer = new Cesium.Viewer ('cesiumContainer', {

ImageryProvider: _ baselayer

});

The slicing method of wgs84 can also be loaded. The code is as follows, but the effect only covers half of the data on the map. There should still be problems:

Var _ tileScheme = new Cesium.GeographicTilingScheme ({

});

Var _ baselayer = new Cesium.UrlTemplateImageryProvider ({

Url: "http://localhost:8001/geoserver/gwc/service/tms/1.0.0/topp%3Astates@EPSG%3A4326@png/{z}/{x}/{reverseY}.png",

TilingScheme: _ tileScheme

});

The above is what it looks like when Cesium loads the layers published by Geoserver. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report