Get started with mapcreator-api CDN

BSD-3-Clause licensed

MapCreator API: Interactive map building in JS for web projects.

Tags:
  • mapping
  • api

Stable version

Copied!

How to start using mapcreator-api CDN


<!DOCTYPE html>
<html>
<head>
    <title>Get started with mapcreator-api CDN - cdnhub.io</title>
    <style>
        #map {
            height: 400px;
            width: 100%;
        }
    </style>
</head>
<body>
    <div id="map"></div>
    <script src="https://cdn.cdnhub.io/mapcreator-api/3.3.1/bundle.browser.min.js"></script>
    <script>
        async function initMap() {
            const map = new MapCreator.Map('map', {
                center: [51.505, -0.09],
                zoom: 13,
                layers: [
                    new MapCreator.TileLayer('OpenStreetMap.Mapnik', {
                        attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' +
                                    '<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
                                    'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
                    }),
                ],
            });

            // Add markers or other features to the map here
        }

        initMap();
    </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!

All versions