I get a list from a table in my database. It contains latitude and longitude. I want to show these makers on Google Map. So here is what i did:
<?php
$exe1 = "SELECT * FROM accident";
$result1 = mysql_query($exe1, $db) or die(mysql_error());
$location = array();
while ($row = mysql_fetch_array($result1)) {
if ($row["latitude"] != "NA") {
$location[] = array(
$row["latitude"],
$row["longitude"],
);
}
}
?>
Then i using JavaScript to get these geo code and push to markers:
for (var i = 0; i < locations.length; i++) {
lat = locations[i][0];
lng = locations[i][1];
}
Because there are so many locations in my table, some of them are have exact same latitude and longitude. I want to show these markers which contain same lat and lng. Anyone know how to do? Appreiciate any help from you!