Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

Commit

Permalink
Shift-zoom to go in/out by 3 levels
Browse files Browse the repository at this point in the history
  • Loading branch information
systemed committed Feb 26, 2017
1 parent a57c83b commit 57fe2b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions net/systemeD/halcyon/Map.as
Expand Up @@ -329,12 +329,12 @@ package net.systemeD.halcyon {
getLayerAt(i).redrawPOIs();
}

public function zoomIn():void {
if (scale!=MAXSCALE) changeScale(scale+1);
public function zoomIn(increment:uint=1):void {
changeScale(Math.min(scale+increment, MAXSCALE));
}

public function zoomOut():void {
if (scale!=MINSCALE_TILES) changeScale(scale-1);
public function zoomOut(increment:uint=1):void {
changeScale(Math.max(scale-increment, MINSCALE_TILES));
}

public function setScale(newscale:uint):void {
Expand Down
4 changes: 2 additions & 2 deletions potlatch2.mxml
Expand Up @@ -78,9 +78,9 @@
<mx:Canvas id="map_area" resize="onResizeMap()"
top="0" left="0" width="100%" height="100%" dragEnter="dragEnterHandler(event);" dragDrop="dragDropHandler(event);">
</mx:Canvas>
<mx:Image source="@Embed('embedded/zoomIn.svg')" left="5" top="5" click="theMap.zoomIn();"
<mx:Image source="@Embed('embedded/zoomIn.svg')" left="5" top="5" click="theMap.zoomIn(event.shiftKey ? 3 : 1);"
rollOverEffect="glowImage" rollOutEffect="unglowImage" toolTip="{'Zoom in - currently z'+getScale()}" />
<mx:Image source="@Embed('embedded/zoomOut.svg')" left="5" top="22" click="theMap.zoomOut();"
<mx:Image source="@Embed('embedded/zoomOut.svg')" left="5" top="22" click="theMap.zoomOut(event.shiftKey ? 3 : 1);"
rollOverEffect="glowImage" rollOutEffect="unglowImage" toolTip="{'Zoom out - currently z'+getScale()}" />
<mx:Image source="@Embed('embedded/search.svg')" left="5" top="42" click="new FindDialog().init();"
rollOverEffect="glowImage" rollOutEffect="unglowImage" toolTip="Find place" />
Expand Down

0 comments on commit 57fe2b4

Please sign in to comment.