Index

Cercalia API Javascript

Cercalia API v5 core use OpenLayers 4.0, integrated with Cercalia platform functionality. The interface is developed using Polymer and Marerial Desing, and It’s 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/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'});
});

Aragó 264 , Barcelona | (+34) 972 20 79 04 | scarbo@ngeografics.com