I use google map to put my json markers in map ( this is my map website ) and this is my main code
function initialize(pram) {
var mapOptions = {
center: new google.maps.LatLng(33.3118943, 44.4959916),
zoom: 11,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var infoWindow = new google.maps.InfoWindow();
var map = new google.maps.Map(document.getElementById("map"), mapOptions);
$.getJSON('data.php?search=' + pram, function (data) {
$.each(data.points, function (i, value) {
var marker = new google.maps.Marker({
position: new google.maps.LatLng(value.lat, value.lon),
map: map
});
google.maps.event.addListener(marker, 'click', portInfo);
function portInfo() {
$("#moreInfoId").html(value.id);
$("#moreInfoPortName").html(value.port_name);
$("#moreInfoTime").html(value.time);
$('#mapModal').modal();
}
});
});
}
I just want when I click on marker its get nearest 5 markers how I do this ?