"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MapLoadIndicator = void 0;
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var MapLoadIndicator = function (props) {
    var loaded = props.loaded, loading = props.loading, color = props.color, position = props.position;
    var visibility = "visible";
    var pc = Math.min(100, (loaded / loading * 100));
    var width = pc.toFixed(1) + "%";
    if (loaded === loading || pc >= 100) {
        visibility = "hidden";
        width = "0";
    }
    var style = {
        position: "absolute",
        zIndex: 10,
        visibility: visibility,
        left: 0,
        height: 5,
        width: width,
        background: color,
        transition: "width 250ms"
    };
    if (position == "top") {
        style.top = 0;
    }
    else {
        style.bottom = 0;
    }
    return React.createElement("div", { style: style });
};
exports.MapLoadIndicator = MapLoadIndicator;
//# sourceMappingURL=map-load-indicator.js.map