Skip to content
Snippets Groups Projects
Commit 23eda610 authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Toggle minimap in Zoomy.

parent 045d80cb
No related merge requests found
......@@ -3,6 +3,7 @@ var Zoomy = {
// Create
init: function(canvas) {
this.canvas = canvas;
this.showMinimap = true;
this.canvas.width = Math.floor(this.canvas.clientWidth);
this.canvas.height = Math.floor(this.canvas.clientHeight);
addEventListener('resize', function() {
......@@ -149,6 +150,8 @@ var Zoomy = {
this.context.restore();
// Minimap
console.log(this.showMinimap);
if(!this.showMinimap) return;
if(this.minimap == null) {
this.minimap = this.initMinimap();
}
......@@ -317,5 +320,9 @@ var Zoomy = {
this.image.height = newHeight;
this.rebound();
this.draw();
},
toggleMap: function() {
this.showMinimap = !this.showMinimap;
this.draw();
}
};
\ No newline at end of file
......@@ -89,6 +89,9 @@
<a class="btn btn-default" onClick="Zoomy.turnLeft()"><i class="fa fa-rotate-left"></i></a>
<a class="btn btn-default" onClick="Zoomy.zoom({deltaY:1})"><i class="fa fa-search-minus"></i></a>
<a class="btn btn-default" onClick="Zoomy.zoom(0,1)">[1:1]</a>
<a class="btn btn-default" onClick="Zoomy.toggleMap();$(this).children('.fa').toggleClass('fa fa-toggle-down').toggleClass('fa fa-toggle-up');" title="<?=$this->transEsc('more_info_toggle') ?>">
<i class="fa fa-toggle-down"></i>
</a>
<a class="btn btn-default" onClick="Zoomy.zoom({deltaY:-1})"><i class="fa fa-search-plus"></i></a>
<a class="btn btn-default" onClick="Zoomy.turnRight()"><i class="fa fa-rotate-right"></i></a>
<canvas id="zoomy"></canvas>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment