// Do we have a key for the grid location?
if (parsed[1].length() > 0) {
gridLoc = KMLService.parseGridLocString(parsed[1]);
}
ConveyorKMLTile tile = new ConveyorKMLTile(sb, parsed[0], gsb.WORLD_EPSG4326.getName(),
gridLoc, MimeType.createFromExtension(parsed[2]), null, request, response);
// Sitemap index ? kml/sitemap.xml
if (parsed[0].equalsIgnoreCase("sitemap") && parsed[2].equalsIgnoreCase("xml")) {
tile.setHint(HINT_SITEMAP_GLOBAL);
String tmpUrl = urlPrefix(request.getRequestURL().toString(), parsed);
tile.setUrlPrefix(tmpUrl.substring(0, tmpUrl.length() - "sitemap".length()));
tile.setRequestHandler(ConveyorTile.RequestHandler.SERVICE);
return tile;
}
// Sitemap ? kml/prefix:layername/sitemap.xml
if (parsed[1].equalsIgnoreCase(HINT_SITEMAP_LAYER)) {
tile.setHint(HINT_SITEMAP_LAYER);
tile.setUrlPrefix(urlPrefix(request.getRequestURL().toString(), parsed));
tile.setRequestHandler(ConveyorTile.RequestHandler.SERVICE);
return tile;
}
// Is this a [super]overlay?
if (parsed[3] != null) {
tile.setRequestHandler(ConveyorTile.RequestHandler.SERVICE);
tile.setUrlPrefix(urlPrefix(request.getRequestURL().toString(), parsed));
tile.setWrapperMimeType(MimeType.createFromExtension(parsed[3]));
}
// Debug layer?
if (tile.getLayerId().equalsIgnoreCase(KMLDebugGridLayer.LAYERNAME)) {
tile.setHint(HINT_DEBUGGRID);
tile.setRequestHandler(ConveyorTile.RequestHandler.SERVICE);
}
// System.out.println(Arrays.toString(tile.getTileIndex()) + " " +
// tile.servletReq.getHeader("referer"));
return tile;