Search in sources :

Example 1 with TiledMap

use of org.activityinfo.server.report.generator.map.TiledMap in project activityinfo by bedatadriven.

the class ImageMapRenderer method drawBasemap.

protected void drawBasemap(MapReportElement element, TileHandler tileHandler) {
    TiledMap map = createTileMap(element);
    BaseMap baseMap = element.getContent().getBaseMap();
    try {
        if (baseMap instanceof TileBaseMap) {
            drawTiledBaseMap(tileHandler, map, baseMap);
        } else if (baseMap instanceof GoogleBaseMap) {
            drawTiledBaseMap(tileHandler, map, MapboxLayers.toTileBaseMap(baseMap));
        }
    } catch (Exception e) {
        LOGGER.log(Level.WARNING, "Exception drawing basemap", e);
    }
}
Also used : TileBaseMap(org.activityinfo.legacy.shared.model.TileBaseMap) TiledMap(org.activityinfo.server.report.generator.map.TiledMap) BaseMap(org.activityinfo.legacy.shared.model.BaseMap) TileBaseMap(org.activityinfo.legacy.shared.model.TileBaseMap) IOException(java.io.IOException)

Example 2 with TiledMap

use of org.activityinfo.server.report.generator.map.TiledMap in project activityinfo by bedatadriven.

the class ImageMapRenderer method createTileMap.

protected TiledMap createTileMap(MapReportElement element) {
    AiLatLng center = element.getCenter() != null ? element.getCenter() : element.getContent().getCenter();
    TiledMap map = new TiledMap(element.getWidth(), element.getHeight(), center, element.getContent().getZoomLevel());
    return map;
}
Also used : AiLatLng(org.activityinfo.model.type.geo.AiLatLng) TiledMap(org.activityinfo.server.report.generator.map.TiledMap)

Aggregations

TiledMap (org.activityinfo.server.report.generator.map.TiledMap)2 IOException (java.io.IOException)1 BaseMap (org.activityinfo.legacy.shared.model.BaseMap)1 TileBaseMap (org.activityinfo.legacy.shared.model.TileBaseMap)1 AiLatLng (org.activityinfo.model.type.geo.AiLatLng)1