Activity › Forums › Salesforce® Discussions › How can I remove the markers that lies outside the circle boundary in Salesforce?
-
How can I remove the markers that lies outside the circle boundary in Salesforce?
Posted by madhulika shah on August 3, 2018 at 1:05 PMHow can I remove the markers that lies outside the circle boundary in Salesforce?
Parul replied 7 years, 7 months ago 4 Members · 3 Replies -
3 Replies
-
I am not sure if the solution I tried is applicable or not.May be the code below will help.
$(function () {
var oldArr = [];var showNearestLocation = function (distance) {
var longitude = myloc.lng,
latitude = myloc.lat;
var res = leafletKnn(gjLayer).nearest(
[longitude, latitude], 5, distance);diff = oldArr.filter(function (x) { return res.indexOf(x) < 0 });
for (j = 0; j < diff.length; j++) {
map.removeLayer(diff[j].layer);
oldArr.splice(oldArr.indexOf(diff[j]), 1);
}if (distance > 0) {
if (res.length) {
map.setView(res[0].layer.getLatLng(), 12);
for (i = 0; i < res.length; i++) {
map.addLayer(res[i].layer);if ($.inArray(res[i], oldArr) === -1)
oldArr.push(res[i]);
}
}
}}
var slider = document.getElementById(‘myRange’);
var output = document.getElementById(‘demo’);
output.innerHTML = slider.value + scale;slider.oninput = function (val) {
output.innerHTML = this.value + scale;
circle.setRadius(this.value);
showNearestLocation(this.value);
}
});thanks.
- [adinserter block='9']
-
Hi,
Could you please provide more detail for your requirement.
Thanks.
-
I didn’t understand the question can you explain more.
Thanks
Log In to reply.