Esempio n. 1
0
    void parseRasterTile(RasterBucket* bucket, std::string data, std::function<void (TileParseResult)> callback) {
        std::unique_ptr<util::Image> image(new util::Image(data));
        if (!(*image)) {
            callback(TileParseResult("error parsing raster image"));
        }

        if (!bucket->setImage(std::move(image))) {
            callback(TileParseResult("error setting raster image to bucket"));
        }

        callback(TileParseResult(TileData::State::parsed));
    }
Esempio n. 2
0
 void parseLiveTile(TileWorker* worker, const LiveTile* tile, std::function<void (TileParseResult)> callback) {
     try {
         callback(worker->parse(*tile));
     } catch (const std::exception& ex) {
         callback(TileParseResult(ex.what()));
     }
 }
Esempio n. 3
0
 void parseVectorTile(TileWorker* worker, std::string data, std::function<void (TileParseResult)> callback) {
     try {
         pbf tilePBF(reinterpret_cast<const unsigned char *>(data.data()), data.size());
         callback(worker->parse(VectorTile(tilePBF)));
     } catch (const std::exception& ex) {
         callback(TileParseResult(ex.what()));
     }
 }
Esempio n. 4
0
 void parsePendingGeometryTileLayers(TileWorker* worker,
                                     std::function<void(TileParseResult)> callback) {
     try {
         callback(worker->parsePendingLayers());
     } catch (const std::exception& ex) {
         callback(TileParseResult(ex.what()));
     }
 }
Esempio n. 5
0
 void parseGeometryTile(TileWorker* worker,
                        std::vector<std::unique_ptr<StyleLayer>> layers,
                        std::unique_ptr<GeometryTile> tile,
                        PlacementConfig config,
                        std::function<void(TileParseResult)> callback) {
     try {
         callback(worker->parseAllLayers(std::move(layers), *tile, config));
     } catch (const std::exception& ex) {
         callback(TileParseResult(ex.what()));
     }
 }