cesium入门示例-geoserver服务访问
1、wms服务访问
1 //wms服务 2 viewer.imageryLayers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({ 3 url: 'http://localhost/geoserver/topp/wms', //服务地址 4 layers: 'topp:countries', //服务图层,需要修改成你自己发布的名称 5 parameters: { 6 service: 'WMS', 7 format: 'image/png', 8 transparent: true 9 } 10 }));
2、wmts服务访问
1 //wmts瓦片服务 2 viewer.imageryLayers.addImageryProvider(new Cesium.WebMapTileServiceImageryProvider({ 3 url: 'http://localhost/geoserver/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0' + 4 '&LAYER=topp:coverage&STYLE=&FORMAT=image/png&TILEMATRIXSET=EPSG:900913&TILEMATRIX=EPSG:900913:{TileMatrix}&TILECOL={TileCol}&TILEROW={TileRow}', //服务地址 5 maximumLevel: 15 6 }));
3、wfs服务访问
1 var promise = Cesium.GeoJsonDataSource.load('http://localhost/geoserver/wfs?' + 2 '&version=1.0.0&request=GetFeature&typeName=topp:Meter&outputFormat=application%2Fjson', { 3 strokeWidth: 3, 4 markerSymbol: 'park', 5 clampToGround: true 6 }); 7 viewer.dataSources.add(promise);