How to use the grid-index.deserialize function in grid-index

To help you get started, we’ve selected a few grid-index examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mapbox / mapbox-gl-js / src / util / web_worker_transfer.js View on Github external
};
}

register('Object', Object);

type SerializedGrid = { buffer: ArrayBuffer };

Grid.serialize = function serialize(grid: Grid, transferables?: Array): SerializedGrid {
    const buffer = grid.toArrayBuffer();
    if (transferables) {
        transferables.push(buffer);
    }
    return {buffer};
};

Grid.deserialize = function deserialize(serialized: SerializedGrid): Grid {
    return new Grid(serialized.buffer);
};
register('Grid', Grid);

register('Color', Color);
register('Error', Error);
register('ResolvedImage', ResolvedImage);

register('StylePropertyFunction', StylePropertyFunction);
register('StyleExpression', StyleExpression, {omit: ['_evaluator']});

register('ZoomDependentExpression', ZoomDependentExpression);
register('ZoomConstantExpression', ZoomConstantExpression);
register('CompoundExpression', CompoundExpression, {omit: ['_evaluate']});
for (const name in expressions) {
    if ((expressions[name]: any)._classRegistryKey) continue;

grid-index

A 2D spatial index for axis-aligned boxes

ISC
Latest version published 6 years ago

Package Health Score

68 / 100
Full package analysis

Similar packages