js/draw_map_hic2.js
//Display text in the center of the canvas
Display text in the center of the canvas
Display text in the center of the canvas
function displayCenterLoc( canvas_id, size_x, size_y, message) {
    var canvas = $( canvas_id )[0];
    if ( canvas )
    {
        var ctx = canvas.getContext("2d");
        if (ctx)
        {
            var text = message;
            var t = ctx.measureText(text).width/2-1;
            ctx.fillStyle = "black";
            ctx.fillText(text, size_x/2-t, size_y/2);
        }
    }
}
function displayCenterLoc ( canvas_id , size_x , size_y , message ) { var canvas = $ ( canvas_id ) [ 0 ] ; if ( canvas ) { var ctx = canvas . getContext ( "2d" ) ; if ( ctx ) { var text = message ; var t = ctx . measureText ( text ) . width / 2 - 1 ; ctx . fillStyle = "black" ; ctx . fillText ( text , size_x / 2 - t , size_y / 2 ) ; } } }
Display text in the center of the canvas
Display text in the center of the canvas