目前我正在开发在原生
android平台的地图上添加WMS源.我正在使用mapbox在应用程序中显示地图.我正在尝试从Geo-server添加WMS源图层但是WMS源图层会在地图上多次添加,如图所示:
这是我用来添加WMS源代码片段:
@覆盖
public void onMapReady(MapboxMap mapboxMap){
RasterSource webMapSource = new RasterSource(
"web-map-source",
new TileSet("tileset", "http://geo.skymetweather.com:8081/geoserver/cite/wms/cite:india_district_web?" +
"&bbox=68.036003112793,6.60812377929688,97.5504302978516," +
"37.2502937316895&format=image/png&service=WMS&version=1.1.1&" +
"request=GetMap&srs=EPSG:4326&width=493&height=512&layers=cite:india_district_web"), 256);
mapboxMap.addSource(webMapSource);
// Add the web map source to the map.
RasterLayer webMapLayer = new RasterLayer("web-map-layer", "web-map-source");
mapboxMap.addLayerBelow(webMapLayer, "aeroway-taxiway");
}
如果代码有任何问题或有人知道如何在地图上添加Raster Source,请建议吗?
提前致谢 !