You can localize your Google Maps API app by changing the default language settings and setting the area code for your app to change the way your app runs based on a given country or region.
The Google Maps API uses the browser's preferred language settings when displaying text information, such as control names, copyright notices, driving directions, and labels on a map. In most cases, this is the preferred practice; You should not generally override the user's preferred language settings. However, if you want to change the maps API to ignore the browser's language settings and have the browser display information in a specific language, you can add optional parameters to the tag when you join the Maps API JavaScript code language
<script>
to specify the language to use.
<script type= "Text/javascript" src= "Http://maps.googleapis.com/maps/api/js?sensor=false&language=ja" >
element to specify the RTL language Web page to render correctly. Regional localizationBy default, the maps API provides map tiles and favors application behavior based on the country/region of the primary domain in which the API is loaded. If you want to change the app to provide different map tiles or biased apps (for example, biased geocoding results closer to an area), you can region
<script>
override the default behavior by adding parameters to the tag when you join the maps API JavaScript code.
As a developer of the Maps API app, it is your responsibility to ensure that your application complies with local laws by ensuring correct regional localization for the country in which your app is hosted.
region
The parameter accepts a Unicode region sub-tag identifier, which is typically mapped to a one-to-one for the country code top-level domain name (ccTLD). In addition to some notable differences, most Unicode region identifiers are identical to the ISO 3166-1 code. For example, the UK CcTLD is "UK" (corresponding to its domain name .co.uk
) and its region identifier is "GB".
For example, to use the Maps API app that is localized to the UK, you can ®ion=GB
add it to the <script>
markup as follows:
<script type= "Text/javascript" src= "Http://maps.googleapis.com/maps/api/js?sensor=false?ion=GB" >
Version controlThe Google maps API team regularly updates this JavaScript API to add new map items, fix bugs, and improve performance. All API changes are backwards compatible to ensure that you are using the current record interface when you launch your app, and that the app can continue to run after the API is updated without modification. ( note : Experimental map items recorded in the experimental API reference are not covered by this warranty.) Experimental map items are explicitly marked in the API documentation. )
Version typeYou only need to specify the API version using the parameters requested by the Maps JavaScript API bootstrapper v
to indicate that you want to load the version in your app. Currently, the system supports the following two options:
- The release version, which can be
v=3
specified using or omitting v
parameters.
- The experimental version, which can be used
v=3.exp
to specify. This version is the current version based on the backbone version, which contains all the bug fixes and new map items that were publicly released.
- A numbered version, with
v=3.number
a representation that specifies the set of map items for the API.
The following bootstrapper request demonstrates how to request a specific version of the Maps JavaScript API:
Http://maps.googleapis.com/maps/api/js?v=3.9&sensor=true_or_false
Each quarter, we build a new numbered version ("release version") and publish it for public use. Throughout the quarter, we will continue to add bug fixes to this release, as well as the maps JavaScript API change log, while ensuring that the set of map itemsets remains stable.
When we issue a new numbered version, we will "freeze" the previous release, which means we are no longer updating it with any code changes (including bug fixes) to ensure its full stability. Each time we launch a new frozen version in this way, the existing frozen version is deactivated. In other words, we will only provide a frozen version for any given time period. Apps that request a numbered version that has been deactivated will automatically receive the current frozen version.
Select API versionWhen choosing the right API version for your Maps API V3 app, you can refer to the following guidelines:
- The production app should specify a release version (
v=3
) or a frozen version. Specifies that a deactivated version (for example v=3.0
) will always return the current frozen version.
- The Maps API for business SLA does not apply to the current experimental version. The Maps API for business app must use the current release version (currently 3.9) or an earlier version in order to apply the SLA.
- When developing the new maps API V3 app, it is recommended that you use the latest experimental version based on the version number (for example, 3.10) until you need to add another map item provided in the newer version to the new version. This way, the version you use will mature as your app is developed, and will become a release version after a period of time, eventually becoming a frozen version.
- Production apps that request a current frozen version or an earlier version should test the latest release every quarter to identify any problems with backward compatibility before the version freezes.
Version documentationThe document will always reflect the experimental version. However, we will provide a separate maintenance reference for each version.
- Version 3.9 references (release)
- Version 3.10 Reference (experiment)
- Version 3.8 Reference (frozen)
- Versions 3.0 through 3.7 are disabled.
Troubleshoot problemsIf your code does not work, you can refer to the following methods to resolve the problem you are experiencing:
- Find spelling errors. Note that the JavaScript language is case sensitive.
- Use the JavaScript debugger. In Firefox, you can use the JavaScript console, the Venkman debugger, or the Firebug plugin. In IE, you can use Microsoft Script Debugger. This series of screenshots demonstrates how to use a variety of debugging tools.
- For questions, please post a question on the Google Maps API v3 online forum.
Last updated February 1, 2013.