Answer the question
In order to leave comments, you need to log in
Online map based on 2gis with its points. But how to do a street search?
Good afternoon!
I am currently using this example
<!DOCTYPE html>
<html>
<head>
<title>Кластеризатор</title>
<script src="http://maps.api.2gis.ru/2.0/loader.js"></script>
<link rel="stylesheet" href="http://2gis.github.io/mapsapi/vendors/Leaflet.markerCluster/MarkerCluster.css" />
<link rel="stylesheet" href="http://2gis.github.io/mapsapi/vendors/Leaflet.markerCluster/MarkerCluster.Default.css" />
<script src="http://maps.api.2gis.ru/2.0/cluster_realworld.js"></script>
</head>
<body>
<div id="map" style="width: 100%; height: 400px;"></div>
<script>
DG.then(function() {
// загрузка кода модуля
return DG.plugin('http://2gis.github.io/mapsapi/vendors/Leaflet.markerCluster/leaflet.markercluster-src.js');
}).then(function() {
map = DG.map('map', {
center: DG.latLng(54.92, 82.82),
zoom: 9
});
var markers = DG.markerClusterGroup();
// обработка координат для установки маркеров
for (var i = 0; i < addressPoints.length; i++) {
var a = addressPoints[i];
var title = a[2];
var marker = DG.marker([a[0], a[1]], { title: title });
marker.bindPopup(title);
markers.addLayer(marker);
}
map.addLayer(markers);
});
</script>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question