

function cargarRadares() {

		var marker, markersArray=[];
		
		/*	json data already loaded from marker_data_01.php by using
			<script type="text/javascript" src="marker_data_01.php"></script>
			on simple.php page
		*/
		
		
      var icon = new GIcon();
      icon.image = "http://www.davifer.es/trafico/cluster.png";
      icon.iconSize = new GSize(22, 33);
      icon.iconAnchor = new GPoint(6, 20);
      icon.infoWindowAnchor = new GPoint(5, 1);    
		
		for (var i=0; i<json.length; i++) {
			marker=newMarker(new GLatLng(json[i].lat, json[i].lng), json[i].id, json[i].texto,icon);
			markersArray.push(marker);
		}
		
		cluster=new ClusterMarker(map, { markers:markersArray } );
		cluster.fitMapToMarkers();
		
		map.savePosition();	//	enables the large map control centre button to return the map to initial view

}

function newMarker(markerLocation, markerId,texto,icon) {

	var marker=new GMarker(markerLocation, {title:'Radar: ['+texto+']',icon:icon});
	GEvent.addListener(marker, 'click', function() {
		marker.openInfoWindowHtml('<p>'+texto+'</p>');
	});
	return marker;
}

function toggleClustering() {
	cluster.clusteringEnabled=!cluster.clusteringEnabled;
	cluster.refresh(true);	//	true required to force a full update of the markers - otherwise the update would occur next time that the map is zoomed or the active markers change
}
