function addMarkers(){ mySelect = document.getElementById('selection'); Lexington = [];mySelect.options[mySelect.options.length] = new Option("Lexington schools",'all=Lexington'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Lexington[Lexington.length] = createMarker(new GPoint(-84.48448800,37.97019000),"
Blue Grass Baptist School
3743 Red River Drive
Lexington, KY 40517
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blue Grass Baptist School",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.49562500,38.00833700),"
Centenary Early Childhood Center
2800 Tates Creek Road
Lexington, KY 40502
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Centenary Early Childhood Center",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.48737100,38.02317500),"
Christ The King School
412 Cochran Road
Lexington, KY 40502
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ The King School",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.54447400,38.00298900),"
Clays Mill Road Christian Academy
3000 Clays Mill Road
Lexington, KY 40503
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clays Mill Road Christian Academy",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.51325500,38.00909000),"
Community Montessori School
166 Crestwood Drive
Lexington, KY 40503
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Community Montessori School",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.50261000,38.01035600),"
Crestwood Christian Church Children
1882 Bellefonte Dr
Lexington, KY 40517
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Crestwood Christian Church Children",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.53300000,38.00710000),"
Fayette Co-op Nursery School
3564-a Clays Mill Rd
Lexington, KY 40503
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fayette Co-op Nursery School",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.51529400,38.01737100),"
Fayette County Operating Nursery School
109 Rosemont Gdn
Lexington, KY 40503
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fayette County Operating Nursery School",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.48690400,38.03888400),"
Good Shepherd Day School
544 Sayre Avenue
Lexington, KY 40508
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Good Shepherd Day School",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.43906500,38.05948500),"
H.t.s.l. Hallis Traditional School
668 Anniston Dr
Lexington, KY 40505
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("H.t.s.l. Hallis Traditional School",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.53057200,38.02658300),"
Lafayette Christian Church Cc
1836 Clays Mill Road
Lexington, KY 40503
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lafayette Christian Church Cc",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.43107300,38.01699300),"
Lexington Christian Academy
2598 Liberty Road
Lexington, KY 40509
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lexington Christian Academy",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.54767000,38.03120200),"
Lexington Junior Academy
968 Lane Allen Road
Lexington, KY 40504
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lexington Junior Academy",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.51236900,38.03789200),"
Lexington Montessori
319 S Broadway Park
Lexington, KY 40504
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lexington Montessori",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.55466600,38.03360500),"
The Lexington School
1050 Lane Allen Road
Lexington, KY 40504
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Lexington School",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.58402600,37.99638000),"
Little Elks Preschool
4343 Harrodsburg Road
Lexington, KY 40513
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Elks Preschool",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.53702000,38.01540300),"
Mary Queen Of The Holy Rosary School
605 Hill N Dale Road
Lexington, KY 40503
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mary Queen Of The Holy Rosary School",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.47560200,37.96942300),"
National Academy
3500 Arbor Drive
Lexington, KY 40517
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("National Academy",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.53159100,37.97172100),"
Porter Memorial Baptist Preschool
4300 Nicholasville Road
Lexington, KY 40515
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Porter Memorial Baptist Preschool",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.52038400,38.05976800),"
Providence Montessori School
1209 Texaco Rd
Lexington, KY 40508
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Providence Montessori School",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.49486300,38.04695900),"
Saints Peter And Paul School
133 Barr Street
Lexington, KY 40507
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Saints Peter And Paul School",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.49460300,38.04794700),"
Sayre School
194 N Limestone
Lexington, KY 40507
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sayre School",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.54352800,38.02065000),"
Southern Hills Montessori School
2356 Harrodsburg Road
Lexington, KY 40503
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southern Hills Montessori School",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.50705000,38.00355900),"
St Michaels School
2025 Bellefonte Drive
Lexington, KY 40503
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Michaels School",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.53900100,38.01156900),"
Summit Christian Academy
2780 Clays Mill Road
Lexington, KY 40503
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Summit Christian Academy",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.48343800,37.96423400),"
Trinity Christian Academy
3900 Rapid Run Drive
Lexington, KY 40515
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Christian Academy",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.51903000,37.98952200),"
Trinity Hill Child Care Center
210 E Reynolds Road
Lexington, KY 40517
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Hill Child Care Center",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-84.42735800,37.96533900),"
Walnut Hill Day School
575 Walnut Hill Road
Lexington, KY 40515
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Walnut Hill Day School",'Lexington=' + Lexington.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/////1/' + showArray); map.removeOverlays(Lexington); 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(Lexington);map.removeOverlays(Lexington); map.addOverlays(Lexington); centerByArray(Lexington, false, false); cntMarker += Lexington.length; centerByArray(Lexington,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=1&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; }