cc.Class({
    extends: cc.Component,

    properties: {
        map:{
            default:null,
            type:cc.Node
        }

    },
    onLoad () {
        this.mapScale();
        var minScale = this.getMinScale(); 
 
        if(Tools.isNull(cc.vv) || Tools.isNull(cc.vv.mapScale)){
            this.map.setScale(1.5,1.5); 
        }else{
            this.map.setScale(cc.vv.mapScale,cc.vv.mapScale); 
        }
        if(cc.vv  && Tools.isValid(cc.vv.mapPos)){
            const pos = cc.vv.mapPos; 
            this.map.setPosition(pos)
            this.fixPos(cc.v2(0,0))
        } 
    }, 
    start () {
        this.node.on(cc.Node.EventType.TOUCH_START, function (event) {
            cc.log("TOUCH_START event=", event.type);
        });

        this.node.on(cc.Node.EventType.TOUCH_MOVE, function (event) {
            cc.log("TOUCH_MOVE event=", event.type);
        });

        this.node.on(cc.Node.EventType.TOUCH_END, function (event) {
            cc.log("TOUCH_END event=", event.type);
        });
    },
});
