Index

Cercalia - API Javascript

Cercalia API v5 core use OpenLayers 4.4.2, integrated with Cercalia platform functionality. The interface is developed using Polymer and Material Dessign, and it is full responsive. The documentation includes Cercalia classes (cercalia namespace) and original OpenLayers classes (ol namespace).

HTML Code

<!DOCTYPE html>
<html>
<head>
    <title>Cercalia API</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <style>
        html, body, #map{
            margin: 0;
            width: 100%;
            height: 100%;
        }
    </style>
    <script src="//maps.cercalia.com/maps/loader.js?key=YOUR_API_KEY&v=5&lang=en&theme=1976d2"></script>
    <script>
        var map;
        document.addEventListener('cercalia-ready', function() {
          map = new cercalia.Map({
            target:'map',
            geolocationEnabled: true
          });
        });
    </script>
</head>
<body>
    <div id="map"></div>
</body>
</html>

Javascript code


var map;
document.addEventListener('cercalia-ready', function() {
  map = new cercalia.Map({
    target:'map'
  });
});

Carrer Joaquim Botet i Sisó 6, Girona & Carrer Aragó 264, Barcelona | (+34) 930 17 27 28 | [email protected]