Language Localization

The map4app API uses the browser’s preferred language setting when displaying textual information such as the names for controls, copyright notices, driving directions and labels on maps. In most cases, this is preferable; you usually do not wish to override the user’s preferred language setting. However, if you wish to change the map4app API to ignore the browser’s language setting and force it to display information in a particular language, you can add an optional language parameter to the <script> tag when including the map4app API javascript code, specifying the language to use.

For example, to display a Maps API application in Italian, add &language=it to the <script> tag as shown below:

<script type="text/javascript" src="http://maps.ubiest.com/map4app/api?client=YOUR-KEY&language=it">

Note: loading the API in the manner shown above will use the Italian language for all users regardless of user preferences. Be sure you wish this behavior before setting this option.

Supported languages
Language Code
Dutch nl
English en
French fr
German de
Italian it
Portuguese pt
Spanish es

Asynchronously Loading the Javascript API

Generally, you load the Javascript map4app API as soon as you load your page by including the API with a <script> tag and executing your application Javascript code after that script has loaded. However, while this Javascript is being parsed, your browser may not render additional content on the page. In most cases, this delay is not noticable, but you may wish to load the map4app API Javascript code after your page has finished loading. You may also wish to load the map4app API Javascript on demand.

It is simple enough to load the map4app Javascript API after a page loads by injecting your own <script> tag in response to a window.onload event, but you need to additionally instruct the map4app Javascript API bootstrap to delay execution of your application code until the map4app Javascript API code is fully loaded. You may do so using the callback parameter. This parameter takes as an argument the function to execute upon completing loading the API.

The following code instructs the application to load the map4app API after the page has fully loaded (using window.onload) and write the map4app Javascript API into a <script> tag within the page. Additionally, we instruct the API to only execute the initialize() function after the API has fully loaded by passing callback=initialize to the map4app API bootstrap:

function initialize() {
  var myLatlng = new ubiest.maps.LatLng(-34.397, 150.644);
  var myOptions = {
    zoom: 8,
    center: myLatlng,
    mapTypeId: ubiest.maps.MapTypeId.ROADMAP
  }
  var map = new ubiest.maps.Map(document.getElementById("map_canvas"), myOptions);
}

function loadScript() {
  var script = document.createElement("script");
  script.type = "text/javascript";
  script.src = "http://maps.ubiest.com/maps/api?client=YOUR-KEY&callback=initialize";
  document.body.appendChild(script);
}

window.onload = loadScript;

Versioning

The map4app team will regularly update this Javascript API with new features, bug fixes, and performance improvements. All API changes will be backwards-compatible, ensuring that if you launch an application using the currently documented interfaces, that application will continue to work without modification as the API is updated. (Note: experimental features are not covered by this guarantee. Features that are experimental will be clearly labeled in the API documentation.)

Types of Versions

You can indicate which version of the API to load within your application by specifying it using the v parameter of the map4app Javascript API bootstrap request. Two options are currently supported:

  • The nightly (development) version, specified omitting the v parameter. This version reflects the current version based off the trunk, including any bug fixes and new features as they are publicly released.
  • A numbered version, indicated with v=number, which specifies a feature set of the API. These numbered versions may either be a release version or a frozen version. (See below.)

The following bootstrap request illustrates how to request a specific version of the map4app Javascript API:

http://maps.ubiest.com/maps/api?client=YOUR-KEY&v=1.7
Choosing an API version

The following guidelines apply when choosing the appropriate API version for your map4app API V3 application:

  • Production applications should always specify a minor version (eg. 1.6, 1.7, etc.).
  • The map4app SLA does not apply to the current Nightly (development) version. map4app applications must use the current Release version, or an earlier version to be covered by the SLA.
  • When developing a new map4app API application, we recommend that you select the latest Nightly version by its version number (eg. 1.7), and then continue to use that version until such time as you need to add additional features available in a later version. In this way the version you are using will mature as your application develops, moving to be the Release and then Frozen version over time.
  • Production applications that request a version equal to or older than the current Frozen version should be tested against the latest Release version once per quarter in order to identify any issues with backwards compatibility in that version before it is frozen.
Documentation of Versions

Documentation will always reflect the nightly (development) version. However, for each version, we will offer a separately maintained reference.
Visit the main Docs page for the list of all references.

.

 
 
 
This website uses cookies to enhance your experience. This website uses cookies, also third parties cookies, to deliver contents and advertising more relevant to you and your interests.
For more information, or to change your cookie settings, click here.
By closing this banner, scrolling this page or selecting any elements on this page, you agree to their use. OK