function addMarkers(){ mySelect = document.getElementById('selection'); Jefferson_City = [];Saint_Thomas = [];mySelect.options[mySelect.options.length] = new Option("Jefferson City schools",'all=Jefferson_City'); mySelect.options[mySelect.options.length] = new Option("Saint Thomas schools",'all=Saint_Thomas'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.14401500,38.56165700),"
Central Baptist Christian Academy
1812 E Mccarty Street
Jefferson City, MO 65101
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Baptist Christian Academy",'Jefferson_City=' + Jefferson_City.length); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.19154900,38.56804000),"
Helias High School
1305 Swifts Highway
Jefferson City, MO 65109
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Helias High School",'Jefferson_City=' + Jefferson_City.length); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.15900300,38.56526400),"
Immaculate Conception School
1208 E Mccarty Street
Jefferson City, MO 65101
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Immaculate Conception School",'Jefferson_City=' + Jefferson_City.length); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.24238000,38.46224400),"
Immanuel Lutheran School
8231 Tanner Bridge Road
Jefferson City, MO 65101
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Immanuel Lutheran School",'Jefferson_City=' + Jefferson_City.length); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.19028800,38.52406300),"
Kim School Montessori
1022 Tara Road
Jefferson City, MO 65101
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kim School Montessori",'Jefferson_City=' + Jefferson_City.length); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.18622300,38.57931000),"
Kindergarten Connection
623 Ohio Street
Jefferson City, MO 65109
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kindergarten Connection",'Jefferson_City=' + Jefferson_City.length); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.16630700,38.56130500),"
Moreau Montessori School
900 Moreau Drive
Jefferson City, MO 65101
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Moreau Montessori School",'Jefferson_City=' + Jefferson_City.length); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.06939000,38.50782600),"
St Francis Xavier School
7307 Route M
Jefferson City, MO 65101
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Francis Xavier School",'Jefferson_City=' + Jefferson_City.length); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.21100700,38.59266800),"
St Joseph Cathedral School
2303 West Main Street
Jefferson City, MO 65109
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Joseph Cathedral School",'Jefferson_City=' + Jefferson_City.length); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.33563200,38.59301200),"
St Martin Elementary School
7206 Saint Martins Boulevard
Jefferson City, MO 65109
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Martin Elementary School",'Jefferson_City=' + Jefferson_City.length); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.17515100,38.57911100),"
St Peter Elementary School
314 W High Street
Jefferson City, MO 65101
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Peter Elementary School",'Jefferson_City=' + Jefferson_City.length); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.17545500,38.48852900),"
St Stanislaus School
6410 Route W
Jefferson City, MO 65101
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Stanislaus School",'Jefferson_City=' + Jefferson_City.length); Saint_Thomas[Saint_Thomas.length] = createMarker(new GPoint(-92.21657400,38.36691300),"
St Thomas The Apostle School
Po Box 211 14830 Route B
Saint Thomas, MO 65076
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Thomas The Apostle School",'Saint_Thomas=' + Saint_Thomas.length); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.18595000,38.56730300),"
Trinity Lutheran Early Childhood
809 Swifts Highway
Jefferson City, MO 65109
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran Early Childhood",'Jefferson_City=' + Jefferson_City.length); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.18674700,38.56510600),"
Trinity Lutheran School
812 Stadium Boulevard
Jefferson City, MO 65109
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Jefferson_City=' + Jefferson_City.length); } // End addStateMarkers JavaScript Function // Takes an array of markers and centers/zooms map based on marker range function centerByArray(myArray, recenter, newMaxMin) { if (newMaxMin == true) reMaxMin(myArray); for (var i = 0; i < myArray.length; i++) { var markLng = myArray[i].getPoint().x; var markLat = myArray[i].getPoint().y; if (markLat > maxLat) maxLat = markLat; if (markLng > maxLng) maxLng = markLng; if (markLat < minLat) minLat = markLat; if (markLng < minLng) minLng = markLng; } if (recenter) reCenterMap(); } // Reinit max/mins function reMaxMin(myArray) { maxLng = myArray[0].getPoint().x; maxLat = myArray[0].getPoint().y; minLng = myArray[0].getPoint().x; minLat = myArray[0].getPoint().y; } // Recenter map based on global max/mins function reCenterMap() { var bounds = new GLatLngBounds(); bounds.extend(new GLatLng(minLat, minLng)); bounds.extend(new GLatLng(maxLat, maxLng)); var center_lat = (bounds.getNorthEast().lat() + bounds.getSouthWest().lat()) / 2.0; var center_lng = (bounds.getNorthEast().lng() + bounds.getSouthWest().lng()) / 2.0; var center = new GLatLng(center_lat, center_lng); var zoom = map.getBoundsZoomLevel(bounds); map.setCenter(center,zoom); //map.setCenter(center,11); /* var center = new GPoint( (maxLng + minLng)/2, (maxLat+minLat)/2 ); var delta = new GSize(maxLng - minLng, maxLat - minLat); var minZoom = map.spec.getLowestZoomLevel(center, delta, map.viewSize); if (minZoom < 4) minZoom = 4; // Lowest possible zoom is 4 map.centerAndZoom(center, minZoom); */ } // Fires when drop down list of schools changes function selectChange(selection) { var myVal = selection.options[selection.selectedIndex].value; map.closeInfoWindow(); // Add entire array based on variable type if (myVal.indexOf('all') != -1 && myVal != 'all') { var temp = myVal.split('='); var showArray = temp[1]; // If Array is > X amount of markers, then open in a new page if (eval(showArray).length > 20) // New window depends on whether or not we're on the search page if (location.href.indexOf('nearby_schools.php') == -1) window.open(location.href + '/map/' + showArray); else window.open('/search/////3/' + showArray); map.removeOverlays(Jefferson_City); map.removeOverlays(Saint_Thomas); map.addOverlays(eval(showArray)); centerByArray(eval(showArray), true, true); // Center and zoom on set of markers } // Add individual markers if (myVal.indexOf('all') == -1 && myVal != 'all' && myVal.length) { var temp = myVal.split('='); var myArray = temp[0]; var myIndex = parseInt(temp[1]) - 1; document.getElementById('map').width = "750"; map.removeOverlay(eval(myArray)[myIndex]); map.addOverlay(eval(myArray)[myIndex]); GEvent.trigger(eval(myArray)[myIndex],'click'); } // Show all markers if (myVal == 'all') { cntMarker = 0; reMaxMin(Jefferson_City);map.removeOverlays(Jefferson_City); map.removeOverlays(Saint_Thomas); map.addOverlays(Jefferson_City); centerByArray(Jefferson_City, false, false); cntMarker += Jefferson_City.length; map.addOverlays(Saint_Thomas); centerByArray(Saint_Thomas, false, false); cntMarker += Saint_Thomas.length; centerByArray(Jefferson_City,true, false); if (cntMarker > 20) // New window depends on whether or not we're on the search page if (location.href.indexOf('schools-by-distance') == -1) window.open(location.href + '/map/all'); else window.open('/search////all'); //window.open('/map.php?type=1&schools=&school_level=3&radius=&zipcode=&school_type_search=&school_type_code='); } } function createMarker(point, label, icon) { var marker = new GMarker(point, icon); var html = label; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }