Use map.setOptions to re-set options after map initialization. Also, you may want to consider: - setting disableDoubleClickZoom to false in MapOptions. - removing the navigation control, which has the ability to change zoom level.
Cheers Chris On Sat, Nov 20, 2010 at 9:57 AM, Behseini <[email protected]> wrote: > Hi guys > I am trying to add a btn click on my map which is supposed to disabled > zoom in or out at current zoom.Here is the code which i am working on > it > > =========================================================== loader.js > function initialize() { > var mylatlng = new google.maps.LatLng(49.249035, -123.122543); > var myMap = { > zoom: 12, > center: mylatlng, > mapTypeId: google.maps.MapTypeId.ROADMAP }; > var map = new > google.maps.Map(document.getElementById("map_canvas"), myMap); > } > function freez(){ > map = new google.maps.Map(document.getElementById("map_canvas"), > myOptions); > alert('You are to Freeze the Map!'); > var myOptions = { > scrollwheel: false > }; > } > =========================================================== end of > loader.js file > and i also have a simple HTML like: > > <html> > <head> > <link rel="stylesheet" type="text/css" href="MapStyle.css" /> > <script type="text/javascript" src="http://maps.google.com/maps/api/js? > sensor=false"></script> > <script type="text/javascript" src="loader.js"></script> > </head> > > <body onload="initialize()"> > <form> > <input type="button" value="Freeze Map Scale"onClick=freez();> > </form> > <p> > <div id="map_canvas" style="width:50%; height:60%"></div> > </body> > </html> > =========================================================== end of > HTML file > could you please give me an idea how I can assign the freez() to my > map or myOptions{} > I tried several methods but they didn't work > best regards > > -- > You received this message because you are subscribed to the Google Groups > "Google Maps JavaScript API v3" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-maps-js-api-v3%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-maps-js-api-v3?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
