I am facing an issue with creating a list of markers on my Google Maps. I want to make a link that will display the values of each marker on the list, as it is looped through using getJson and <li>
is only appended during the loop.
Could someone assist me in turning it into a clickable link that will alert the values?
Below are the sets of codes I am currently using:
<script type="text/javascript">
var geocoder;
var map;
function initialize() {
var minZoomLevel = 4;
geocoder = new google.maps.Geocoder();
map = new google.maps.Map(document.getElementById('map'), {
zoom: minZoomLevel,
center: new google.maps.LatLng(38.50, -90.50),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
// Bounds for North America
var strictBounds = new google.maps.LatLngBounds(
new google.maps.LatLng(15.70, -160.50),
new google.maps.LatLng(68.85, -55.90)
);
...
</script>
This is how LoadWorkerList works:
public JsonResult LoadWorkerList()
{
var workerList = new List<Worker_Address>();
// retrieve list of workers
var list = (from a in db.Worker_Address
where a.LogicalDelete == false
select a).ToList();
...
return Json(wlist.ToList().OrderBy(p => p.AddressLine1), JsonRequestBehavior.AllowGet);
}