<div id="map" style="width: 100%; height: 400px;"></div>
DG.then(function() {
                var map;

                map = DG.map('map', {
                    center: [54.98, 82.89],
                    zoom: 13
                });

                map.locate({setView: true, watch: true})
                    .on('locationfound', function(e) {
                        DG.marker([e.latitude, e.longitude]).addTo(map);
                    })
                    .on('locationerror', function(e) {
                        DG.popup()
                          .setLatLng(map.getCenter())
                          .setContent('Location access denied')
                          .openOn(map);
                    });
            });

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://maps.api.2gis.ru/2.0/loader.js?pkg=full&amp;skin=light