public void getTileMapService ( final String baseUrl , final Callback < TileMapServiceInfo , String > callback ) { RequestBuilder builder = new RequestBuilder ( RequestBuilder . GET , baseUrl ) ; builder . setHeader ( "Cache-Control" , "no-cache" ) ; builder . setHeader ( "Pragma" , "no-cache" ) ; try { builder . sendRequest ( null , new RequestCallback ( ) { public void onError ( Request request , Throwable e ) { callback . onFailure ( e . getMessage ( ) ) ; } public void onResponseReceived ( Request request , Response response ) { if ( 200 == response . getStatusCode ( ) ) { Document messageDom = XMLParser . parse ( response . getText ( ) ) ; callback . onSuccess ( new TileMapServiceInfo100 ( messageDom . getDocumentElement ( ) ) ) ; } else { callback . onFailure ( response . getText ( ) ) ; } } } ) ; } catch ( RequestException e ) { // Couldn't connect to server callback . onFailure ( e . getMessage ( ) ) ; } }
Fetch the capabilities of a TileMapService and parse it . This is the base URL that contains a list of TileMaps .