Select to view content in your preferred language

Custom Zoom not working

1012
6
04-11-2013 11:14 AM
SethCrotchett
Emerging Contributor
I am trying to implement custom zoom in and zoom out buttons.  It doesn't seem to be working.  I was looking at one of the examples.  http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/toolbar_navigation.html

The custom zoom in and zoom out buttons in the example dont work either so this makes me believe there is a bug.

Can anyone help me on this?  Is this a bug or am i doing something wrong?
0 Kudos
6 Replies
BenjaminGriggs
Emerging Contributor
The custom zoom in and zoom out buttons work fine for me in that example. I am accessing from Firefox 19. What browser are you using?

Could you post some code where the problem is occurring?
0 Kudos
SethCrotchett
Emerging Contributor
I have tried the sample on multiple browsers.  Chrome and Firefox on Mac.

Chrome Version:  26.0.1410.65
Firefox: 19.0.2
0 Kudos
BenjaminGriggs
Emerging Contributor
Are you properly dragging the tool to select the extent you wish to zoom in / zoom out on?
Do you receive any errors when attempting to zoom with either tool?
0 Kudos
SethCrotchett
Emerging Contributor
Ok, i was thinking the zoom in button would just zoom in one level.  I didn't know you had to draw on the map for it to zoom.  Is there a way to have a custom zoom in button do what i was expecting?  So you press the zoom in button and it zooms in one level and so on.
0 Kudos
BenjaminGriggs
Emerging Contributor
You could create a zoom in button and zoom out button that call the following functions when clicked:

function zoomInLevel() {
    map.setLevel(map.getLevel() +1);
}

function zoomOutLevel() {
    map.setLevel(map.getLevel() -1);
}
0 Kudos
derekswingley1
Deactivated User
Ok, i was thinking the zoom in button would just zoom in one level.  I didn't know you had to draw on the map for it to zoom.  Is there a way to have a custom zoom in button do what i was expecting?


This is what the + and �?? buttons in the top left corner of the map do.
0 Kudos