function Map(client, canvas, anchor, options) {
    this.client = client;
    this.canvas = canvas;
    this.context = canvas.getContext("2d");
    this.anchor = {x: 0, y: 0, z: 0};
    this.targetid = -1;

    // Fill out missing coordinates with zero in the anchor.
    if (anchor)
        $.extend(this.anchor, anchor);

    if (typeof anchor === "function") {
	    this.getAnchor = this.anchor;
    } else {
	    this.getAnchor = function() {
	        return this.anchor;
	    }
    }

    // Retrieve the options for scaling, because they need to be used to
    // determine the height and width.
    this.opts = {
        planeW: "x",
        planeH: "y",
	    borderColor: "#ffffff",
        sectorLineWidth: 2,
        subSectorLineWidth: 1,
	    sectorColor: "#99f",
	    subSectorColor: "#55a",
	    sizeW: 10000, // X display width is 10000m
	    sizeH: 10000  // Y display width is 10000m
    };

    if (options)
	    $.extend(this.opts, options);

    this.sizeW = this.opts.sizeW;
    this.sizeH = this.opts.sizeH;

    this.rescale($(this.canvas).width(), $(this.canvas).height());
    this.redraw();
}
// borderColor  : sets the color of the map's borders
borderColor  : sets the color of the map's borders
borderColor : sets the color of the map ' s borders
function Map(client, canvas, anchor, options) {
    this.client = client;
    this.canvas = canvas;
    this.context = canvas.getContext("2d");
    this.anchor = {x: 0, y: 0, z: 0};
    this.targetid = -1;
    if (anchor)
        $.extend(this.anchor, anchor);
    if (typeof anchor === "function") {
	    this.getAnchor = this.anchor;
    } else {
	    this.getAnchor = function() {
	        return this.anchor;
	    }
    }
    this.opts = {
        planeW: "x",
        planeH: "y",
	    borderColor: "#ffffff",
        sectorLineWidth: 2,
        subSectorLineWidth: 1,
	    sectorColor: "#99f",
	    subSectorColor: "#55a",
	    sizeW: 10000, 
	    sizeH: 10000  
    };
    if (options)
	    $.extend(this.opts, options);
    this.sizeW = this.opts.sizeW;
    this.sizeH = this.opts.sizeH;
    this.rescale($(this.canvas).width(), $(this.canvas).height());
    this.redraw();
}
function Map ( client , canvas , anchor , options ) { this . client = client ; this . canvas = canvas ; this . context = canvas . getContext ( "2d" ) ; this . anchor = { x : 0 , y : 0 , z : 0 } ; this . targetid = - 1 ; if ( anchor ) $ . extend ( this . anchor , anchor ) ; if ( typeof anchor === "function" ) { this . getAnchor = this . anchor ; } else { this . getAnchor = function ( ) { return this . anchor ; } } this . opts = { planeW : "x" , planeH : "y" , borderColor : "#ffffff" , sectorLineWidth : 2 , subSectorLineWidth : 1 , sectorColor : "#99f" , subSectorColor : "#55a" , sizeW : 10000 , sizeH : 10000 } ; if ( options ) $ . extend ( this . opts , options ) ; this . sizeW = this . opts . sizeW ; this . sizeH = this . opts . sizeH ; this . rescale ( $ ( this . canvas ) . width ( ) , $ ( this . canvas ) . height ( ) ) ; this . redraw ( ) ; }
borderColor  : sets the color of the map's borders
borderColor : sets the color of the map ' s borders
// Fill out missing coordinates with zero in the anchor. // Retrieve the options for scaling, because they need to be used to // determine the height and width. // X display width is 10000m // Y display width is 10000m