Skip to content

Instantly share code, notes, and snippets.

@itanka9
Last active December 29, 2021 17:21
Show Gist options
  • Select an option

  • Save itanka9/d0f1dc646ccbb6a300175b6794b41a95 to your computer and use it in GitHub Desktop.

Select an option

Save itanka9/d0f1dc646ccbb6a300175b6794b41a95 to your computer and use it in GitHub Desktop.
Simple Map with a Marker
license: mit

Simple Map with a Marker in center.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2GIS Map API</title>
<meta name="description" content="Quckstart with 2GIS Map API">
<style>
html,
body,
#container {
margin: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
</style>
</head>
<body>
<div id="container"></div>
<script src="https://mapgl.2gis.com/api/js/v1"></script>
<script>
// API key can be used on jsfiddle.net only!
// You can get more info on https://docs.2gis.com/
const map = new mapgl.Map('container', {
center: [55.31878, 25.23584],
zoom: 13,
key: 'bfd8bbca-8abf-11ea-b033-5fa57aae2de7',
style: 'c080bb6a-8134-4993-93a1-5b4d8c36a59b'
});
const marker = new mapgl.Marker(map, {
coordinates: [55.31878, 25.23584],
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment