Currently I am working on the adding a WMS source on the map in native android platform. I am using mapbox to show map in the application. I am trying to add a WMS source layer from Geo-server But the WMS source layer getting added multiple times over the map as shown in the picture :
Here is the code snippet which I have used to add WMS source :
@Override 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");
}
Please suggest if any thing wrong with the code or does anyone know how to add Raster Source on Map?
Thanks in advance !