How to use the mapv.baiduMapCanvasLayer function in mapv

To help you get started, we’ve selected a few mapv 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 huiyan-fe / react-bmap / src / components / road.js View on Github external
initialize() {
        var map = this.props.map;
        if (!map) {
            return;
        }

        const update = this.canvasLayerUpdate.bind(this);
        if (this.canvasLayer) {
            this.canvasLayer.draw();
        } else {
            this.canvasLayer = new baiduMapCanvasLayer({
                zIndex: this.props.zIndex,
                map,
                update() {
                    update(this);
                }
            });
            if (this.props.onClick) {
                map.addEventListener('click', (e) => {

                    var isClick = false;
                    if (this.props.roadPaths) {
                        for (var i = 0; i < this.props.roadPaths.length; i++) {
                            var roadPath = this.props.roadPaths[i];
                            isClick = this.isClick(map, e.pixel, roadPath);
                            if (isClick) {
                                this.props.onClick(i);