Includes enterprise licensing and support
google.maps.* namespace?
BitmapData.draw/3D effects in the Flash API?
The Google Maps APIs give developers several ways of embedding Google Maps into web pages, and allows for either simple use or extensive customization. There are now several API offerings: Google Maps Javascript API, Google Maps API for Flash, Google Static Maps API. In addition, we also offer the Mapplets API to enable the creation of mini-applications that run inside Google Maps. Depending on your needs, you may find yourself using one or a combination of these APIs.
If you operate an enterprise or commercial website, you may also be interested in Google Maps API Premier.
The Google Maps team is constantly pushing new map data out and increasing our international coverage. The following spreadsheet shows the latest coverage details. You can filter the spreadsheet with the drop downs at the top (e.g. see all countries with driving directions by selecting "Yes" from that drop down). Please note that data coverage can change if licensing agreements with the data providers change.
Check out the
Map Coverage Details Spreadsheet.
Also see the
Supported Languages Spreadsheet.
Yes. Google Maps now offers the ability to embed the map that you're viewing into your website or blog, without any programming or use of the Google Maps APIs.
More information is available here.
The Google Maps JavaScript API v3 has been developed to cater to mobile devices, and is suitable for browser applications targetted at both the desktop and devices that include a web browser with a full JavaScript implementation, such as the Apple iPhone.
For browser based applications targetted at devices not suitable for using the JavaScript API, the Static Maps API delivers map images in GIF, JPG, and PNG formats, including markers and polylines. Note that it is not permitted to use the Static Maps API outside of browser based applications.
To incorporate maps in an Android application, use the Android Maps External Library.
To incorporate Maps in a native iPhone application, use the Apple iPhone Map Kit framework.
The Google Maps JavaScript API currently supports the following web browsers:
The Google Maps API for Flash is supported for stable releases of Flash Player 9 from 9.0.151.0 onwards. Flash Player 10 is not officially supported at this time.
The development tools that are officially supported are Flex Builder 3, Adobe Flash CS3, and the Flex 3 SDK.
Yes, absolutely. There's no limit to the number of page views of Maps on your site. If you expect your site to generate over 500,000 page views per day, please contact us so we can provision additional capacity to handle your traffic.
Please bear in mind that the geocoding feature (converting addresses to coordinate pairs) is subject to the usage limits documented in this FAQ.
Simply sign up for an API key, and you can start putting maps on your site. See the Maps API documentation for examples and details.
You should subscribe to the Google Geo Developers Blog for news updates across the various Google Geo developer offerings.
To be notified when there are changes that may affect your applications, such as new releases, please subscribe to the relevant notify Google Group for the API concerned:
The Terms of Service for the Google Maps API are available at:
http://www.google.com/apis/maps/terms.html
The Terms of Service for Google Maps API Premier are available at:
https://support.google.com/enterprise/doc/gme/terms/maps_purchase_agreement.html
The Maps API is available for all sites that are accessible to consumers without charge. You can use the Google Maps APIs on both commercial and non-profit websites as long as your site meets the Terms of Service.
However, there are some uses of the Google Maps APIs that we just don't want to see: maps that identify the places to buy illegal drugs in a city, for instance, or any other illegal activity. We also respect people's privacy, so the Google Maps APIs shouldn't be used to identify private information about individuals.
You should use your own counsel to determine whether your application complies with the Terms of Service before you develop and launch it. Google engineers can only offer technical assistance and are not qualified to offer legal advice. Google reserves the right to suspend or terminate your use of the service at any time, so please read the Terms of Service carefully.
If you operate an enterprise or commercial website, you may also be interested in Google Maps API Premier which has modified Terms of Service that may better suit your needs.
You may not access the maps or satellite images through any mechanism besides the Google Maps APIs (such as the creation of your own mapping API or the use of a bulk tile download script). Your application's access to the tiles will be blocked if it accesses them outside of the Google Maps APIs. See section 5.3 of the Google Terms of Use for more details.
As long as your site is generally accessible to consumers without charge, you may use the Google Maps API. For example, if your website is supported by advertising, it likely falls within the Google Maps API Terms of Service. If you charge people to place information on your map (e.g. to list their homes for sale), but you display this information using the Google Maps API on a free part of your site, you'll also meet the Google Maps API Terms of Service.
However, not all commercial uses are allowed. If your site meets any of the following criteria you must use Google Maps API Premier:
Remember, Google reserves the right to suspend or terminate your use of the Google Maps API at any time, so please ensure that you read the Terms of Service carefully.
There is no restriction on displaying real-time data (tracking) with the Google Maps APIs provided that the application is publicly available without charge and otherwise complies with the Terms of Service. For internal-only applications, Google Maps API Premier must be used. See Section 10.9 of the Terms of Service for more information.
Yes, the Google Maps APIs can now be used in Desktop applications, provided that they adhere to the other restrictions of the Terms of Service. Note that in order for a desktop application to be deemed "publicly accessible", there must be a publicly accessible webpage from which it can be downloaded. See Section 7.1c of the Terms of Service for more information.
Yes, you can, though you should consult the Terms of Service before using the Google Maps APIs on a password protected website. If consumers can easily sign up for a password without charge or if the purpose of the password protected map is to enhance the publicly available map (ie. administration), then your site is likely within the Terms of Service. If this is not the case, you will need to use Google Maps API Premier.
Per Section 9.2 of the Terms of Service, developers must report whether their Maps API implementation uses a sensor to locate the user's device on the map. An example of a sensor is the Geolocation module in Gears, which provides a latitude/longitude for a user based on their WIFI/GPS/Cell ID information.
Information is available on reporting use of a sensor in the JavaScript Maps API, and in the Static Maps API. There is not currently a mechanism for specifying use of a sensor for developers using the Maps API for Flash.
Note that since the sensor parameter was only recently introduced, pre-existing sites will not be disabled for failing to define the parameter. Developers are required to start reporting the parameter as soon as possible, however.
Use of Google Maps imagery in printed materials and offline media is subject to the Permission Guidelines published at:
To remove your page or site from search results, follow the instructions provided in our webmaster help center. If we enable indexing of any content that is a part of your Maps API implementation, we will provide updated instructions to opt out of including that content in search results.
You may not store and serve copies of images generated using the Google Static
Maps API from your website. All web pages that require static map images must
link the src attribute of an HTML img tag or the CSS
background-image attribute of an HTML div tag
directly to the Google Static Maps API so that all map images are displayed
within the HTML content of the web page and served directly to end users by
Google.
In order to register for a Google Maps API key, you must sign in to your Google Account and agree to our Terms of Service. There is no limit to the number of keys you may obtain under a single account.
For most applications we recommend that you simply register your domain name. Your key will be valid for that domain, its subdomains, all URLs on hosts in those domains, and all ports on those hosts.
For example, if you sign up for a key using
http://www.mygooglemapssite.com/, your key is valid for:
http://www.mygooglemapssite.com/http://www.mygooglemapssite.com/mysite/However this key will not be valid for:
http://mygooglemapssite.com/http://host1.mygooglemapssite.com/http://host2.mygooglemapssite.com/mysite
If as recommended you request a key for
http://mygooglemapssite.com/ your key will be valid for all of
the URLs listed above.
Note that a key for http://www.mygooglemapssite.com/ will only be
accepted when the site is accessed using this address. It will not be accepted
if the site is accessed by IP address (eg. http://10.1.2.3/) or
by a hostname that is aliased to www.mygooglemapssite.com using a
DNS CNAME record.
If you are developing on a local drive (file://), the key check
is skipped in the Google Maps Javascript API and it is less restrictive in the
Google Maps API for Flash. Note also that developing on the local drive with
the Google Maps API for Flash will result in tiles with "DEBUG" painted on
them. If you are developing on localhost, you will need to
register a key for http://localhost.
If you are using the Javascript Maps API and your key is not working on your
site, put an alert(window.location.host) in your code and reload
the page. The domain you see in that alert is the one on which your key should
be registered.
If you're using the Maps API for Flash and your key is not working, make sure the key is registered for the domain from which the SWF is being served, not for the domain on which the SWF is embedded.
We maintain a list of changes between Google Maps API versions at:
http://groups.google.com/group/Google-Maps-API/web/api-version-changes
You can also check which version of the Google Maps API a particular bug was introduced and fixed in using the Google Maps API Issue Tracker at:
The API version currently used when a particular version is not specified is given at:
http://groups.google.com/group/Google-Maps-API/web/api-version-changes
You can read more about the Google Maps Javascript API versioning system in the Google Maps API Developer Guide.
google.maps.* namespace?
The standard method for loading the API creates global objects such as
GMarker, GMap2, etc. As of version 2.134d of the
API, objects are additionally declared within the
google.maps.* namespace. Developers who want the objects to
only be inside the namespace can specify
"file=googleapionly" instead of "file=api" when
loading the API in the script tag.
Both the Google Maps JavaScript API v2 and v3 can be loaded into a page
asynchronously after the page has loaded using the AJAX Common Loader. When
using the Common Loader, the API is only loaded when
google.load("maps", ...) is called, which can happen at any time
after the Common Loader has loaded.
Alternatively the v2 API can be loaded directly from
http://maps.google.com/
using the async and callback parameters, as
illustrated in
this code sample. The v3 API can be loaded asynchronously in the same way,
although only the callback parameter is required.
Check out the Supported Languages Spreadsheet.
There are various situations where the Google Maps APIs accepts or produces textual output: Map controls, copyrights, geocodes, and driving directions. Since different languages may use different character sets, the Google Maps APIs allows you to specify the output character encoding by appending an 'oe' parameter to your script tag or query, or to specify the input character encoding by appending an 'ie' parameter. For example, you could force UTF-8 encoding in map controls in the Google Maps Javascript API by modifying your script tag like so:
<script src="http://maps.google.com/maps?file=api&v=2&oe=utf-8&key=abcdefg">
You could also change the output of the HTTP geocoder by modifying the query like so:
http://maps.google.com/maps/geo?q=1600+Amphitheatre+Parkway,+Mountain+View,+CA&output=xml&oe=utf8&key=abcdefg
The Google Maps JavaScript API and Google Static Maps API can be accessed over a secure (HTTPS) connection by Google Maps API Premier customers. If the Google Maps APIs are used with a free Maps API key on a secure site, the browser may warn the user about non-secure objects on the screen.
Additionally, KML/GeoRSS files stored on a secure server cannot be parsed with the Javascript API's GGeoXML class.
The Google Maps API for Flash can be used in a Flash application (SWF file) that is hosted on an SSL (HTTPS) site. However it is not possible to load the Google Maps API for Flash over HTTPS. When the Google Maps API for Flash is used in a Flash application that is hosted on an https site, the API is loaded over HTTP, and all connections to Google made by the API are over HTTP.
To use the Google Maps API for Flash in a Flash application hosted on an SSL site, you must:
Security.allowInsecureDomain("maps.googleapis.com");
BitmapData.draw/3D effects in the Flash API?
The Maps API for Flash does not currently allow calls to
BitmapData.draw(). Calling this method will result in a run-time
Security Sandbox error. Several ActionScript libraries call this function in
order to enable transitions or 3-d effects, such as
PaperVision3d. If you are using
those libraries in your application, make sure you're not using them on the
map. To be notified if this situation changes, please star
this issue
.
If you experience behavior that you believe may be a bug, please begin by raising it in the Google Maps API Google Group. This will allow other developers to validate the bug, and rule out any potential issues with your code.
If you wish to request a feature, please also first raise it in the Google Maps API Google Group to confirm that a solution that meets your requirements is not already available.
Once you have confirmed that you have identified a new bug, or that your requirements can not be met by the existing functionality of the Google Maps APIs, please report your bug or feature request using the Google Maps API Issue Tracker.
Before adding a bug or feature request to the Issue Tracker please be sure to check that the bug or feature concerned has not already been added. If it has, you can star the issue to register your interest and be notified of updates.
Please post your question in the Google Maps API discussion group to get help from the Google Maps developer community. The Google Maps team also monitors and participates in this group.
For best results when requesting help, please keep the following in mind:
Google Maps API Premier customers may also contact Google Enterprise Support.
Yes, this process is called "geocoding." each of the Google Maps APIs includes a class for performing geocoding. The classes are:
Alternatively Google also provides a HTTP Geocoding Service, which offers a REST interface that can respond in XML, JSON, and CSV format.
Please be aware of the usage limits that apply to geocoder requests, and note that use of the geocoder for any purpose other than obtaining locations that will be displayed using the Google Maps APIs is a violation of the Terms of Service. You may use the HTTP geocoder to geocode addresses outside of your Google Maps API application so that they may be cached and later displayed using one of the Google Maps APIs, but locations obtained using the HTTP geocoder may not be used by any other application, distributed by other means, or resold.
To see countries currently supported by the Google Maps APIs geocoders, please check out this spreadsheet and select "Yes" in the geocoding dropdown.
The accuracy of geocoded locations may vary per country, so you should consider using the returned accuracy parameter to determine if a good enough match has been found for the purposes of your application. Please note that the availability of geocoding data depends on our contacts with data providers, so it is subject to change.
For geocoding in countries not currently supported by the Google Maps APIs, please browse this list of other geocoding services.
If more than 15,000 geocode requests in a 24 hour period are received from a single IP address, or geocode requests are submitted from a single IP address at too fast a rate, the Google Maps API geocoder will begin responding with a status code of 620. This article explains how to time geocode requests from PHP and provides sample code for doing so. If excessive geocoder usage continues, access to the Google Maps API geocoder from this IP address may be blocked permanently.
When using one of the Maps API geocoding classes, requests are made by the user's web browser and count against the quota for the user's IP address. This means that excessive usage on the part of one user will not impact other users of your site. However, if many users access the Google Maps APIs through a single proxy, they will share the quota of the IP address of the proxy.
When geocoder requests are made using the HTTP Geocoding Service they count against the quota for the IP address of the system making the HTTP request. If you need to submit a very large set of addresses to the HTTP Geocoding Service to cache for later use, you should consider Google Maps API Premier, which provides a separate batch geocoding quota for this purpose.
You can also supplement the Google Maps API geocoder with another geocoding service, a list of which is available here.
The API geocoder and Google Maps geocoder sometimes use different data sets (depending on the country). The API geocoder occasionally gets updated with new data, so you can expect to see results changing or improving over time.
The Google Maps APIs geocoder requires that U.S. numbered highways be specified in addresses as follows:
"Co Road NNN" where NNN is the road number. eg.
"Co Road 82"
"State NNN" where State is the full name of the
state and NNN is the highway number. eg. "California 82"
"U.S. NNN" where NNN is the highway number.
eg. "U.S. 101"
"Interstate NNN" where NNN is the interstate
number. eg. "Interstate 280"
The Accuracy value represents the scale of the feature that has been geocoded. It does not represent a ranking or level of confidence in the result.
When the geocoder receives a query it attempts to find the best matched feature for the address given. Depending on the amount of data we have for the area concerned, the geocoder may be able to identify a specific building that matches, or it may only be able to match the street or district.
If the geocoder can only match a higher level feature such as the district it will still return a lat/long, but it will be for the centroid of that feature, which is likely to be offset from the location of the specific address requested. The Accuracy tells you the scale of the object that matched, so you know how precise the geocode is likely to be.
The list of possible values for the Accuracy and the scale of feature that each represents is given in the Google Maps Javascript API Reference.
The geocoder is designed to map street addresses to geographical coordinates. We therefore recommend that you format geocoder requests in accordance with the following guidelines to maximise the likelihood of a successful query:
Google provides two different techniques for performing geocoding. Each of the Maps APIs includes a class for performing geocoding and Google also provides a HTTP Geocoding Service.
If the set of locations that your application will need to geocode is known and fixed, such as the properties on a real estate site, or the hotels on a travel site, you should use the HTTP Geocoding Service to geocode all of the addresses once, cache them server side, and serve the coordinates directly to users. This avoids the need for the same addresses to be repeatedly geocoded every time they are displayed, and improves site performance. By geocoding your addresses in this way you can also control the rate of requests and daily volume to ensure that none fail because too many queries were sent.
If however your application requires geocoding in order to service users that are performing address searches on your site, the appropriate API geocoder class should be used. This ensures that the geocoding requests are sent directly to Google from each user. There are limits on the number of geocoding requests per day and the rate of geocoding requests per second that Google will service from a single IP address. By using client side geocoding you ensure that these limits apply to each user individually, rather than to the combined request volume generated by all of your users. It also ensures that the requests are made directly to Google, which will improve the performance of your application.
The Google Maps Javascript API allows you to provide driving directions via the GDirections class. This class provides you with step-by-step access to basic and multi-point driving directions, and can automatically create the overlays and directions panel for you. Additional examples are provided in the documentation.
You can also easily link to Google Maps for driving directions. We suggest you use the following format for driving directions on Google Maps:
http://maps.google.com/maps?saddr={start_address}&daddr={destination_address}
To see countries currently supported by GDirections in the Javascript API, check out this spreadsheet and choose "Yes" in the driving directions column dropdown. Please note that the availability of driving directions data depends on our contacts with data providers, so it is subject to change.
Additionally, GDirections can translate the driving directions
instructions into another language by setting the "locale" parameter in the
GDirections.load method. The spreadsheet referenced above also indicates
current languages available, in the localized column.
The GGeoXML class in the Javascript API enables developers to overlay KML/KMZ and GeoRSS files on top of the map. Examples are here.
The KML features currently supported by the GGeoXML class are
documented at:
http://code.google.com/apis/kml/documentation/mapsSupport.html
Support for additional geospatial features may be added to the
GGeoXml
class in the future. Check back here or stay tuned to the
Google Geo Developers
blog for updated information.
The size and complexity limits on the display of KML using the
GGeoXML class are documented at:
http://code.google.com/apis/kml/documentation/mapsSupport.html
There is no limit to the number of markers or path vertices supported by the Google Static Maps API. However Static Maps API URLs can be a maximum of approximately 2,000 characters which constrains the number of markers and path vertices that can be specified based on the number of decimal places used when specifying each latitude/longitude pair. For information on how the number of decimal places used relates to the accuracy on the Earth see the Wikipedia article on Decimal Degrees.
Yes, you're welcome and encouraged to monetize your maps mashup through advertising. The JavaScript Maps API offers several classes to help you put advertising in your maps mashups. Read the developer's guide for more information.
You can also put AdSense ad units on the same page as your map mashup, outside of the map.
To sign up for AdSense and get a publisher ID, or to learn how to put ad units on your page, visit adsense.google.com.
If you're using the ads layer, you'll generate revenue each time a user clicks on a link in one of the ad layer's info windows. It's not possible to say how much you'll earn for a certain number of clicks, because your earnings will depend on the actual cost-per-click (CPC) bid by advertisers. However, you can rest assured that we'll always serve the ads that are predicted to maximize your revenue. More information on AdSense revenue is generated is available in the AdSense Help Center.
To find your unique AdSense publisher ID number, log into your AdSense account at http://www.google.com/adsense. On the My Account tab, scroll down to the Property info section. Your publisher ID for each AdSense product and feature will be located in this section.
Alternatively, you can find your publisher ID number within your AdSense code. Just locate the AdSense code in the HTML source code of your website, and you'll spot your publisher ID in a line like the one shown below:
google_ad_client="ca-pub-xxxxxxxxxxxxxxxx";
Please refer to the information on channels in the AdSense Help Center.
Any developer whose page content is in one of the AdSense for Content languages can implement the ads layer. Currently, only advertisers from the United States will show ads in the ads layer. As the program continues, ads from advertisers in other countries may become available.
If you've implemented the ads layer by initializing a GAdsManager
on your map and aren't seeing any ads, there may be several reasons:
GAdsManager constructor, and make sure you
call enable() on GAdsManager after initialization.