back | source
Basic map creation
  1. Using the following script within tag <head> </head>
    (xxxxxxxxxxxxxx represents map key)
    <script src="https://api.longdo.com/map/?key=xxxxxxxxxxxxxx"></script>
    
  2. Div element for creating map within tag <body></body>
    <div id="map"></div>
  3. JavaScript function for creating longdo.Map object within tag <head></head>
    <script>
      var map;
      function init() {
        map = new longdo.Map({
          placeholder: document.getElementById('map'),
          language: 'en'
        });
      }
    </script>
    • placeholder: A DOM element to place the map in
  4. Using onload within tag <body>
    <body onload="init();">

Changing map layer
  1. Using setBase(layer)
    map.Layers.setBase(longdo.Layers.TERRAIN);
    example
    [Layers]