Select to view content in your preferred language

Custom Zoom in/out button

583
1
09-26-2010 11:50 AM
RhondaThynne
Regular Contributor
Hi there,

I am not familiar with writing code so I thought I could get some help here.
I am looking to create a custom fixed zoom in/out button that will display our basemap "All_NS" at fixed zoom levels e.g. 1:18,000 1: 36,000.
The reason I am trying to do this, is our basemap is  cached image tiles...so when we zoom using the zoom tool the basemap can look very pixelated.
Any help will be greatly appreciated!
Thank you
Tags (3)
0 Kudos
1 Reply
RolfBroch
Frequent Contributor
Create a tool with the following code
    <TOOLBUTTON name="tbtScale50000" caption="50 000" image="@setmapscale" tooltip="1:50 000" prompt="1:50 000" onclick="Map.Scale=50000">
     <MENUITEM name="tbtScale25000" caption="25 000" image="@setmapscale" tooltip="1:25 000" prompt="1:25 000" onclick="Map.Scale=25000"/>
     <MENUITEM name="tbtScale10000" caption="10 000" image="@setmapscale" tooltip="1:10 000" prompt="1:10 000" onclick="Map.Scale=10000"/>
     <MENUITEM name="tbtScale5000" caption="5 000" image="@setmapscale" tooltip="1:5 000" prompt="1:5 000" onclick="Map.Scale=5000"/>
     <MENUITEM name="tbtScale1000" caption="1 000" image="@setmapscale" tooltip="1:1 000" prompt="1:1 000" onclick="Map.Scale=1000"/>
     <MENUITEM name="tbtScale500" caption="500" image="@setmapscale" tooltip="1:500" prompt="1:500" onclick="Map.Scale=500"/>
    </TOOLBUTTON>
and change the tooltip, prompt, caption and value for the onclick to the values that correspond to what you want. You will then get a dropdown tool where you can click to set the scale values you want.

Rolf
0 Kudos