Rendering the map

The ol is the OpenLayers package that provides the API to play with the maps overlay.

ol.Maps

The core essential component of the ol package is ol.Maps. It is used to render the maps on the target div, which in our case is map-overlay a div tag from index.html where the map will be shown: 

    // Renders the map on the target div    var map = new ol.Map({target: "map"})

ol.View

This is used to manage or configure the viewing properties of the map such as zoom level, default center position, and the projection of the map:

    // To configure center, zoom level and projection of the map    var view = new ol.View({      zoom: 9    });

ol.layer

A layer is a visual representation of data from a source. It is used to show the data on the map that ...

Get Kotlin Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.