-
-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
200 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
activities/ColorMyWorld.activity/js/palettes/zoompalette.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="zoombuttons-container"> | ||
<div class="zoombuttons" id = "zoom-in-button"></div> | ||
<div class="zoombuttons" id = "zoom-out-button"></div> | ||
<div class="zoombuttons" id = "zoom-original-button"></div> | ||
</div> |
56 changes: 56 additions & 0 deletions
56
activities/ColorMyWorld.activity/js/palettes/zoompalette.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
define([ | ||
'sugar-web/graphics/palette', | ||
'text!activity/palettes/zoompalette.html', | ||
], function (palette, template) { | ||
var zoompalette = {} | ||
zoompalette.ZoomPalette = function (invoker, primaryText) { | ||
palette.Palette.call(this, invoker, primaryText) | ||
this.getPalette().id = 'zoom-palette' | ||
|
||
var containerElem = document.createElement('div') | ||
containerElem.innerHTML = template | ||
|
||
this.setContent([containerElem]) | ||
|
||
var zoomIn = document.getElementById('zoom-in-button') | ||
var zoomOut = document.getElementById('zoom-out-button') | ||
var zoomOriginal = document.getElementById('zoom-original-button') | ||
|
||
zoomIn.addEventListener('click', function () { | ||
var view=window.map.getView(); | ||
var zoom = view.getZoom(); | ||
view.animate({zoom:zoom+1}) | ||
}) | ||
|
||
zoomOut.addEventListener('click', function () { | ||
var view=window.map.getView(); | ||
var zoom = view.getZoom(); | ||
view.animate({zoom:zoom-1}) | ||
}) | ||
|
||
zoomOriginal.addEventListener('click', function () { | ||
var view=window.map.getView(); | ||
view.animate({zoom:2.3299654139527806}) | ||
}) | ||
|
||
} | ||
|
||
var addEventListener = function (type, listener, useCapture) { | ||
return this.getPalette().addEventListener(type, listener, useCapture) | ||
} | ||
|
||
zoompalette.ZoomPalette.prototype = Object.create( | ||
palette.Palette.prototype, | ||
{ | ||
addEventListener: { | ||
value: addEventListener, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
}, | ||
}, | ||
) | ||
|
||
return zoompalette | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters