The New Google Maps Interface

by | Mar 3, 2009

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.

 

Categories

Recent Posts

Eric Pimpler
Eric is the founder and owner of GeoSpatial Training Services (geospatialtraining.com) and has over 25 years of experience implementing and teaching GIS solutions using ESRI, Google Earth/Maps, Open Source technology. Currently Eric focuses on ArcGIS scripting with Python, and the development of custom ArcGIS Server web and mobile applications using JavaScript. Eric is the author of Programming ArcGIS with Python Cookbook - 1st and 2nd Edition, Building Web and Mobile ArcGIS Server Applications with JavaScript, Spatial Analytics with ArcGIS, and ArcGIS Blueprints. Eric has a Bachelor’s degree in Geography from Texas A&M University and a Master's of Applied Geography degree with a concentration in GIS from Texas State University.

Sign up for our weekly newsletter
to receive content like this in your email box.