The New Google Maps Interface

Posted on March 3, 2009. Filed under: Google Maps |

The Google Maps default interface was recently updated to a new styling which you can easily implement in your Google Maps application. The GMap2 class has seen the recent addition of a new ‘setUIToDefault()’ method that will automatically update your application to the default interface found at maps.google.com. In addition, adding this line of code will ensure that any future changes implemented in the user interface at maps.google.com will be reflected in your application without any additional changes.

This function includes default controls and functionality that are dependent upon the size of your map.

Maps 300 x 400 pixels or smaller

• GMenuMapTypeControl
• GSmallZoomControl3D



Maps Larger than 300 x 400 pixels

• GLargeMapControl3D
• GMapTypeControl
• GScaleControl

Here is a simple example of the concepts.

In both cases the scroll wheel zoom, and double click zoom will be enabled, and a GKeyboardHandler is added to the map.

In addition to the GMap2.setUIToDefault() method, you can also use an instance of the new GMapUIOptions class for fine grained control of the new interface. For instance, the following code block get an instance of GMapUIOptions, disables double click zoom, and removes the scale control. The GMap2.getDefaultUI() method gets an instance of GMapUIOptions before the various properties are set.

More Information
To obtain additional information on the Google Maps API please see our e-learning course, “Introduction to the Google Maps API“.  In addition, GeoSpatial Training Services also provides a full set of Google Earth and ESRI  e-learning courses.  Please see our website for more details.

Make a Comment

Leave a comment

Liked it here?
Why not try sites on the blogroll...