[GIS] WMS-C Google Maps v2 Android

androidgoogle mapswms

I'm have added a map from a WMS-server in Google Maps v2 for Android using the code provided from this site: http://www.azavea.com/blogs/labs/2013/01/wms-on-android/ . The tiles are downloaded and displayed but something is not working properly. The map looks blurry and the detail level is low.

I have tried fiddling around with the bbox parameters and if I increase the value for each point multiplying by 4, I can see a greater resolution and more details in the map but the tiles are way off.

Do I have to add some parameters to the wmsurl like resolution or something?

Best Answer

Make sure your projection is correct and the tile request is 256px by 256px

private static final String GEOSERVER_FORMAT =
            "http://yourApp.org/geoserver/wms" +
            "?service=WMS" +
            "&version=1.1.1" +              
            "&request=GetMap" +
            "&layers=yourLayer" +
            "&bbox=%f,%f,%f,%f" +
            "&width=256" +
            "&height=256" +
            "&srs=EPSG:900913" +
            "&format=image/png" +               
            "&transparent=true";

source: http://www.azavea.com/blogs/labs/2013/01/wms-on-android/