Google Maps API default control look-and-feel

Although I haven’t managed to do any work with the Google Maps API for a few months now, I do try and frequent the Google Geo Developers Blog every once in a while.

On my last visit I noticed a post mentioning new functionality that allows you to include the standard user interface elements you get on the main Google Maps site, plus the standard behaviour of keyboard and mouse handling.

Google Maps default UI

To include the new UI and behaviours, include the following code:

// var map = new GMap2(mapDiv);
map.setUIToDefault();

This function will ensure that any updates to the maps.google.com UI will also be reflected on your site without you having to carry out any updates.

Read the full blog post here.

2 Replies to “Google Maps API default control look-and-feel”

  1. Hey mate, I have used a google map on a recent post I have made. It still has the default arrows and zoom icons. When will the new look be implimented?

    I am also having trouble with keeping the google map integrated with my site keeps just randomly disappearing when I put it to a larger width than 300.

    Like

  2. Hiya.

    If you are using the Google Maps API then just add map.setUIToDefault(); to your JavaScript.

    The default style has not yet been implemented if you use the embedded iframe option from maps.google.com.

    I’m not sure but I believe there may be restrictions on the maximum dimensions / map size you can have, at least this is the case if using the static maps.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: