Отдельная кластеризация для платных точек
This commit is contained in:
parent
f7bf8ad601
commit
f46a263ffa
|
|
@ -56,6 +56,7 @@ suggestInit('#addressField');
|
||||||
function init(lat, lng) {
|
function init(lat, lng) {
|
||||||
myMap = L.map('map', {zoomControl: false}).setView([lat, lng], defaultZoom);
|
myMap = L.map('map', {zoomControl: false}).setView([lat, lng], defaultZoom);
|
||||||
markers = new L.MarkerClusterGroup({showCoverageOnHover: false, maxClusterRadius: 30});
|
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 © <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['quest'] = L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png', {attribution: 'Map data © <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 © <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});
|
layers['osm'] = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {attribution: 'Map data © <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) {
|
success: function (data) {
|
||||||
for(var i=0; i<data.length; i++) {
|
for(var i=0; i<data.length; i++) {
|
||||||
if (typeof points[data[i].id] == 'undefined') {
|
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]));
|
markers.addLayer(constructPoint(data[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
myMap.addLayer(markers);
|
myMap.addLayer(markers);
|
||||||
|
myMap.addLayer(markersPlus);
|
||||||
|
|
||||||
if (useBounds == true) {
|
if (useBounds == true) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue