, , , , markersTest. , , markersTest , , .
javascript, , / :
15 function addTestMarkers(){
16 for(var i in markersTest) {
17 var location = new google.maps.LatLng(markersTest[i][1], markersTest[i][2]);
18 marker = new google.maps.Marker({
19 position: location,
20 map: map
21 });
22 }
23 }
24
25 // Removes the overlays from the map, but keeps them in the array
26 function clearOverlays() {
27 if (markersTest) {
28 for (i in markersTest) {
29 markersTest[i].setMap(null);
30 }
31 }
32 }
addTestMarkers, markersTest , . clearOverlays markersTest .
: markersTest, javascript markerDestinations, javascript markersTest,
markersTest = {};
addTestMarkers :
function addTestMarkers() {
for(var i in markerDestinations) {
var location = new google.maps.LatLng(markersDestinations[i][1], markersDestinations[i][2]);
markersTest[i] = new google.maps.Marker({
position: location,
map: map
});
}
}
, addTestMarkers markersTest.