Get started with maptalks CDN
BSD-3-Clause licensed
Maptalks is an open-source library for creating interactive maps and location-based applications.
Tags:- javascript
- gis
- map
- 2d-maps
- 3d-maps
- geospatial
- maps
- maptalks
Stable version
Copied!
How to start using maptalks CDN
// Include MapTalks library
const script = document.createElement('script');
script.src = 'https://cdn.cdnhub.io/maptalks/0.49.5/maptalks.min.js';
document.head.appendChild(script);
// Wait for MapTalks to load
window.onMapTalksReady = () => {
// Create a Map object
const map = new maptalks.Map('map', {
center: [0, 0], // Set initial center coordinates
zoom: 2 // Set initial zoom level
});
// Add a base layer (OpenStreetMap)
map.addBaseLayer(new maptalks.OpenStreetMapLayer());
// Create a marker at a specific location
const marker = new maptalks.Marker(map.getCenter(), {
draggable: true,
icon: new maptalks.Icon('marker.png', new maptalks.Size(32, 32))
});
// Add the marker to the map
map.addMapObject(marker);
};
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
All versions
0.45.0
0.45.1
0.46.0
0.47.0
0.47.1
0.47.2
0.47.3
0.47.4
0.47.5
0.48.0
0.49.0
0.49.1
0.49.2
0.49.3
0.49.4
*** 0.49.5
1.0.0-alpha-19
1.0.0-alpha.10
1.0.0-alpha.11
1.0.0-alpha.12
1.0.0-alpha.13
1.0.0-alpha.14
1.0.0-alpha.15
1.0.0-alpha.16
1.0.0-alpha.17
1.0.0-alpha.18
1.0.0-alpha.19
1.0.0-alpha.2
1.0.0-alpha.20
1.0.0-alpha.21
1.0.0-alpha.22
1.0.0-alpha.23
1.0.0-alpha.24
1.0.0-alpha.25
1.0.0-alpha.26
1.0.0-alpha.27
1.0.0-alpha.28
1.0.0-alpha.3
1.0.0-alpha.4
1.0.0-alpha.5
1.0.0-alpha.6
1.0.0-alpha.7
1.0.0-alpha.8
1.0.0-alpha.9
1.0.0-beta.1
1.0.0-beta.10
1.0.0-beta.2
1.0.0-beta.3
1.0.0-beta.4
1.0.0-beta.5
1.0.0-beta.6
1.0.0-beta.7
1.0.0-beta.8
1.0.0-beta.9
1.0.0-rc.1
1.0.0-rc.10
1.0.0-rc.11
1.0.0-rc.12
1.0.0-rc.13
1.0.0-rc.14
1.0.0-rc.15
1.0.0-rc.16
1.0.0-rc.17
1.0.0-rc.18
1.0.0-rc.19
1.0.0-rc.2
1.0.0-rc.20
1.0.0-rc.21
1.0.0-rc.22
1.0.0-rc.23
1.0.0-rc.24
1.0.0-rc.25
1.0.0-rc.26
1.0.0-rc.27
1.0.0-rc.28
1.0.0-rc.3
1.0.0-rc.4
1.0.0-rc.5
1.0.0-rc.6
1.0.0-rc.7
1.0.0-rc.8
1.0.0-rc.9