How to use the @hpcc-js/leaflet-shim.Util.extend function in @hpcc-js/leaflet-shim

To help you get started, we’ve selected a few @hpcc-js/leaflet-shim 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 hpcc-systems / Visualization / packages / map / src / leaflet / AlbersPR.ts View on Github external
if (!point) {
            point = projAlbers([latLng.lng, latLng.lat]);
        }
        return new Point(point[0], point[1]);
    },
    unproject(point) {
        if (!isNaN(point.x) && !isNaN(point.y)) {
            const latLng = projAlbers.invert([point.x, point.y]);
            return new LatLng(latLng[1], latLng[0]);
        } else {
            return new LatLng(0, 0);
        }
    }
};

const AlbersCRS = Util.extend({}, CRS, {
    projection: AlbersProjection,
    transformation: new Transformation(1, 0, 1, 0),
    infinite: true
});

export class AlbersLayer extends TileLayer {

    _crs = AlbersCRS;

    constructor() {
        super();
    }

    hasBounds() {
        return true;
    }