Отдельная кластеризация для платных точек

This commit is contained in:
Krivchikov Dmitry 2016-01-16 13:21:53 +03:00
parent f7bf8ad601
commit f46a263ffa
1 changed files with 7 additions and 1 deletions

View File

@ -56,6 +56,7 @@ suggestInit('#addressField');
function init(lat, lng) {
myMap = L.map('map', {zoomControl: false}).setView([lat, lng], defaultZoom);
markers = new L.MarkerClusterGroup({showCoverageOnHover: false, maxClusterRadius: 30});
markersPlus = new L.MarkerClusterGroup({showCoverageOnHover: false, maxClusterRadius: 25});
layers['quest'] = L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png', {attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>', maxZoom: 18});
layers['osm'] = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery ©</a>', maxZoom: 18});
@ -194,10 +195,15 @@ function initPoints(useBounds)
success: function (data) {
for(var i=0; i<data.length; i++) {
if (typeof points[data[i].id] == 'undefined') {
if (data[i]['categoryId'] == 24 || data[i]['categoryId'] == 25) {
markersPlus.addLayer(constructPoint(data[i]));
} else {
markers.addLayer(constructPoint(data[i]));
}
}
}
myMap.addLayer(markers);
myMap.addLayer(markersPlus);
if (useBounds == true) {
return true;