VIAMICHELIN JAVASCRIPT API


Quickstart

Loading of  the APIJS

 

To load the APIJS ViaMichelin , use the script tag on the following example, on the head tag of your HTML code, with your Key number and the language chosen (LANG).

 

<script src="http://apijsv2.viamichelin.com/apijsv2/api/js?key=KEY&lang=LANG" type="text/javascript"> </script>               

 

For more details about KEY and, please refer to the loading of APIJS.

 

Use of the Completion Address

 

In this case, we will plug the completion address component to an input text.

It will helps the user on his search. When he will start to type, it will suggest him addresses according to the letters he typed.

 

 HTML

The only element required for completion is a text input element (<input>).

 

  

<div>Saisissez une adresse (entry of address) </div>
<div><input type="text" /></div>  

 

Configuration of the component

To plug the component, the only property to mention for the configuration is the input.

 

   
       var conf = {
           input : document.getElementById("address")
        };
   

Declaration of callbacks

 

For a basic use of the completion, you don’t need to specify the callbacks.

 

Connection of the component

The completion address component is called ViaMichelin.Api.Completion.Address.

It works with the VMLaunch method and “conf” variable.

VMLaunch("ViaMichelin.Api.Completion.Address", conf);        

Demonstration

If you want to check the result of this guide, consult the page demonstration.