Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
have edit my maps forge project to display different type o button for zoom in and zoom out. Now i would like to add different buttons when max zoom and min zoom are reached. How can i do this?

I have changed the classic buttons with this script

Java
ImageButton zoomIn = (ImageButton) findViewById(R.id.zoomIn);
zoomIn.setBackgroundResource(R.drawable.action_click_zoom_in);
zoomIn.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {

            mapView.getMapViewPosition().zoomIn();

    }

});

ImageButton zoomOut = (ImageButton) findViewById(R.id.zoomOut);
zoomOut.setBackgroundResource(R.drawable.action_click_zoom_out);
zoomOut.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {

        mapView.getMapViewPosition().zoomOut();

    }
});
Posted
Updated 24-Mar-14 4:57am
v2
Comments
Krunal Rohit 22-Mar-14 10:47am    
As you have already set your custom drawable file for the button, what is the error now ?


-KR
[no name] 22-Mar-14 14:09pm    
Hi, simply i want the zoom image be replace to another when is reached the max zoom or the min zoom level
TorstenH. 24-Mar-14 10:59am    
disable the button, but do not change the button to another function.
That would confuse the user. other function = other button position

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900