function addMarkers(){ mySelect = document.getElementById('selection'); Honolulu = [];Kahului = [];Ewa_Beach = [];Waipahu = [];Lahaina = [];Wailuku = [];Kailua = [];Kapaa = [];Aiea = [];Mililani = [];Hilo = [];Makawao = [];Waialua = [];Kaneohe = [];Kekaha = [];mySelect.options[mySelect.options.length] = new Option("Aiea schools",'all=Aiea'); mySelect.options[mySelect.options.length] = new Option("Ewa Beach schools",'all=Ewa_Beach'); mySelect.options[mySelect.options.length] = new Option("Hilo schools",'all=Hilo'); mySelect.options[mySelect.options.length] = new Option("Honolulu schools",'all=Honolulu'); mySelect.options[mySelect.options.length] = new Option("Kahului schools",'all=Kahului'); mySelect.options[mySelect.options.length] = new Option("Kailua schools",'all=Kailua'); mySelect.options[mySelect.options.length] = new Option("Kaneohe schools",'all=Kaneohe'); mySelect.options[mySelect.options.length] = new Option("Kapaa schools",'all=Kapaa'); mySelect.options[mySelect.options.length] = new Option("Kekaha schools",'all=Kekaha'); mySelect.options[mySelect.options.length] = new Option("Lahaina schools",'all=Lahaina'); mySelect.options[mySelect.options.length] = new Option("Makawao schools",'all=Makawao'); mySelect.options[mySelect.options.length] = new Option("Mililani schools",'all=Mililani'); mySelect.options[mySelect.options.length] = new Option("Waialua schools",'all=Waialua'); mySelect.options[mySelect.options.length] = new Option("Wailuku schools",'all=Wailuku'); mySelect.options[mySelect.options.length] = new Option("Waipahu schools",'all=Waipahu'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.85431400,21.31828500),"
Cathedral Catholic Academy
1728 Nuuanu Avenue
Honolulu, HI 96817
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cathedral Catholic Academy",'Honolulu=' + Honolulu.length); Kahului[Kahului.length] = createMarker(new GPoint(-156.46640200,20.88494600),"
Christ The King School
211 Kaulawahine St
Kahului, HI 96732
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ The King School",'Kahului=' + Kahului.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.86851600,21.33070700),"
Damien Memorial School
1401 Houghtailing Street
Honolulu, HI 96817
All-boys school, 7-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Damien Memorial School",'Honolulu=' + Honolulu.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.93049100,21.33792500),"
Holy Family Catholic Academy
830 Main Street
Honolulu, HI 96818
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Family Catholic Academy",'Honolulu=' + Honolulu.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.72875000,21.28356900),"
Holy Trinity School
5919 Kalanianaole Highway
Honolulu, HI 96821
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Trinity School",'Honolulu=' + Honolulu.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.83053800,21.30052700),"
Maryknoll School
1526 Alexander St
Honolulu, HI 96822
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Maryknoll School",'Honolulu=' + Honolulu.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.83057100,21.30052000),"
Maryknoll School
1526 Alexander St
Honolulu, HI 96822
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Maryknoll School",'Honolulu=' + Honolulu.length); Ewa_Beach[Ewa_Beach.length] = createMarker(new GPoint(-158.00636200,21.31653800),"
Our Lady Of Perpetual Help School
91-1010 North Road
Ewa Beach, HI 96706
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Perpetual Help School",'Ewa_Beach=' + Ewa_Beach.length); Waipahu[Waipahu.length] = createMarker(new GPoint(-157.99350100,21.40986900),"
Rosary Preschool & Kindergarte
94-1249 Lumikula St
Waipahu, HI 96797
school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rosary Preschool & Kindergarte",'Waipahu=' + Waipahu.length); Lahaina[Lahaina.length] = createMarker(new GPoint(-156.67599300,20.87548000),"
Sacred Hearts School And Early Learning Center
239 Dickenson Street
Lahaina, HI 96761
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Hearts School And Early Learning Center",'Lahaina=' + Lahaina.length); Wailuku[Wailuku.length] = createMarker(new GPoint(-156.49572600,20.89197000),"
St. Anthony Jr/sr High School
1618 Lower Main Street
Wailuku, HI 96793
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Anthony Jr/sr High School",'Wailuku=' + Wailuku.length); Kailua[Kailua.length] = createMarker(new GPoint(-157.73919500,21.40040900),"
St. Anthony School
148 Makawao Street
Kailua, HI 96734
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Anthony School",'Kailua=' + Kailua.length); Kapaa[Kapaa.length] = createMarker(new GPoint(-159.31676600,22.09205100),"
St. Catherine School
5021 Kawaihau Road
Kapaa, HI 96746
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Catherine School",'Kapaa=' + Kapaa.length); Aiea[Aiea.length] = createMarker(new GPoint(-157.93003600,21.37649400),"
St. Elizabeth Elementary School
99-310 Moanalua Road
Aiea, HI 96701
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Elizabeth Elementary School",'Aiea=' + Aiea.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.81230600,21.30440700),"
St. Francis School
2707 Pamoa Road
Honolulu, HI 96822
All-girls school, 6-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("St. Francis School",'Honolulu=' + Honolulu.length); Kailua[Kailua.length] = createMarker(new GPoint(-157.72866900,21.37956500),"
St. John Vianney Parish School
940 Keolu Drive
Kailua, HI 96734
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. John Vianney Parish School",'Kailua=' + Kailua.length); Mililani[Mililani.length] = createMarker(new GPoint(-158.01452300,21.45799900),"
St. John's Catholic Preschool
95-370 Kuahelani Avenue
Mililani, HI 96789
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. John's Catholic Preschool",'Mililani=' + Mililani.length); Waipahu[Waipahu.length] = createMarker(new GPoint(-158.00834000,21.38300600),"
St. Joseph Elementary School
94-651 Farrington Highway
Waipahu, HI 96797
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Joseph Elementary School",'Waipahu=' + Waipahu.length); Hilo[Hilo.length] = createMarker(new GPoint(-155.08379300,19.71384000),"
St. Joseph Jr/sr High School
1000 Ululani Street
Hilo, HI 96720
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Joseph Jr/sr High School",'Hilo=' + Hilo.length); Makawao[Makawao.length] = createMarker(new GPoint(-156.30844800,20.85635000),"
St. Joseph School
1294 Makawao Avenue
Makawao, HI 96768
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Joseph School",'Makawao=' + Makawao.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.80895200,21.28798300),"
St. Louis School
3142 Waialae Ave
Honolulu, HI 96816
All-boys school, 5-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("St. Louis School",'Honolulu=' + Honolulu.length); Waialua[Waialua.length] = createMarker(new GPoint(-158.12085100,21.56873700),"
St. Michaels Elementary School
67-340 Haona Street
Waialua, HI 96791
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Michaels Elementary School",'Waialua=' + Waialua.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.91402700,21.34671900),"
St. Philomena Early Learning Center
3300 Ala Laulani St
Honolulu, HI 96818
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Philomena Early Learning Center",'Honolulu=' + Honolulu.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.86101400,21.32371200),"
St. Theresa Catholic School
712 N School Street
Honolulu, HI 96817
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Theresa Catholic School",'Honolulu=' + Honolulu.length); Kaneohe[Kaneohe.length] = createMarker(new GPoint(-157.80566800,21.42154300),"
St Anns School
46-125 Haiku Road
Kaneohe, HI 96744
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Anns School",'Kaneohe=' + Kaneohe.length); Wailuku[Wailuku.length] = createMarker(new GPoint(-156.50620000,20.88820000),"
St Anthony Grade School
1627a Mill Street
Wailuku, HI 96793
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Anthony Grade School",'Wailuku=' + Wailuku.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.88217000,21.33045500),"
St Anthony School-honolulu
640 Puuhale Road
Honolulu, HI 96819
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Anthony School-honolulu",'Honolulu=' + Honolulu.length); Kekaha[Kekaha.length] = createMarker(new GPoint(-159.72890000,22.02010000),"
St Theresa School
Po Box 277
Kekaha, HI 96752
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Theresa School",'Kekaha=' + Kekaha.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.92888000,21.33892000),"
Star Of The Sea Early Learning Center
4470 Aliikoa Street Suite 100
Honolulu, HI 96821
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Star Of The Sea Early Learning Center",'Honolulu=' + Honolulu.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.78103300,21.28026300),"
Star Of The Sea School
4469 Malia Street
Honolulu, HI 96821
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Star Of The Sea School",'Honolulu=' + Honolulu.length); map.removeOverlays(Aiea); map.removeOverlays(Ewa_Beach); map.removeOverlays(Hilo); map.removeOverlays(Honolulu); map.removeOverlays(Kahului); map.removeOverlays(Kailua); map.removeOverlays(Kaneohe); map.removeOverlays(Kapaa); map.removeOverlays(Kekaha); map.removeOverlays(Lahaina); map.removeOverlays(Makawao); map.removeOverlays(Mililani); map.removeOverlays(Waialua); map.removeOverlays(Wailuku); map.removeOverlays(Waipahu); setTimeout(function(){map.addOverlays(Aiea)},1000); setTimeout(function(){map.addOverlays(Ewa_Beach)},1000); setTimeout(function(){map.addOverlays(Hilo)},1000); setTimeout(function(){map.addOverlays(Honolulu)},1000); setTimeout(function(){map.addOverlays(Kahului)},1000); setTimeout(function(){map.addOverlays(Kailua)},1000); setTimeout(function(){map.addOverlays(Kaneohe)},1000); setTimeout(function(){map.addOverlays(Kapaa)},1000); setTimeout(function(){map.addOverlays(Kekaha)},1000); setTimeout(function(){map.addOverlays(Lahaina)},1000); setTimeout(function(){map.addOverlays(Makawao)},1000); setTimeout(function(){map.addOverlays(Mililani)},1000); setTimeout(function(){map.addOverlays(Waialua)},1000); setTimeout(function(){map.addOverlays(Wailuku)},1000); setTimeout(function(){map.addOverlays(Waipahu)},1000); maxLng = -155.08379300; maxLat = 22.09205100; minLng = -159.72890000; minLat = 19.71384000; reCenterMap(); } // 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//////' + showArray); map.removeOverlays(Aiea); map.removeOverlays(Ewa_Beach); map.removeOverlays(Hilo); map.removeOverlays(Honolulu); map.removeOverlays(Kahului); map.removeOverlays(Kailua); map.removeOverlays(Kaneohe); map.removeOverlays(Kapaa); map.removeOverlays(Kekaha); map.removeOverlays(Lahaina); map.removeOverlays(Makawao); map.removeOverlays(Mililani); map.removeOverlays(Waialua); map.removeOverlays(Wailuku); map.removeOverlays(Waipahu); 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(Honolulu);map.removeOverlays(Aiea); map.removeOverlays(Ewa_Beach); map.removeOverlays(Hilo); map.removeOverlays(Honolulu); map.removeOverlays(Kahului); map.removeOverlays(Kailua); map.removeOverlays(Kaneohe); map.removeOverlays(Kapaa); map.removeOverlays(Kekaha); map.removeOverlays(Lahaina); map.removeOverlays(Makawao); map.removeOverlays(Mililani); map.removeOverlays(Waialua); map.removeOverlays(Wailuku); map.removeOverlays(Waipahu); map.addOverlays(Aiea); centerByArray(Aiea, false, false); cntMarker += Aiea.length; map.addOverlays(Ewa_Beach); centerByArray(Ewa_Beach, false, false); cntMarker += Ewa_Beach.length; map.addOverlays(Hilo); centerByArray(Hilo, false, false); cntMarker += Hilo.length; map.addOverlays(Honolulu); centerByArray(Honolulu, false, false); cntMarker += Honolulu.length; map.addOverlays(Kahului); centerByArray(Kahului, false, false); cntMarker += Kahului.length; map.addOverlays(Kailua); centerByArray(Kailua, false, false); cntMarker += Kailua.length; map.addOverlays(Kaneohe); centerByArray(Kaneohe, false, false); cntMarker += Kaneohe.length; map.addOverlays(Kapaa); centerByArray(Kapaa, false, false); cntMarker += Kapaa.length; map.addOverlays(Kekaha); centerByArray(Kekaha, false, false); cntMarker += Kekaha.length; map.addOverlays(Lahaina); centerByArray(Lahaina, false, false); cntMarker += Lahaina.length; map.addOverlays(Makawao); centerByArray(Makawao, false, false); cntMarker += Makawao.length; map.addOverlays(Mililani); centerByArray(Mililani, false, false); cntMarker += Mililani.length; map.addOverlays(Waialua); centerByArray(Waialua, false, false); cntMarker += Waialua.length; map.addOverlays(Wailuku); centerByArray(Wailuku, false, false); cntMarker += Wailuku.length; map.addOverlays(Waipahu); centerByArray(Waipahu, false, false); cntMarker += Waipahu.length; centerByArray(Honolulu,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///8191,8090,8147,8148,8173,8174,8180,8185,8162,8083,8090,8109,8111,8148,8173,8174,8196,8197,8182,8200,8201,8086,8181,8187,8178,8183,8198,8172,8192,8188,8194,8179,8170,8190,/all'); //window.open('/map.php?type=2&schools=8191,8090,8147,8148,8173,8174,8180,8185,8162,8083,8090,8109,8111,8148,8173,8174,8196,8197,8182,8200,8201,8086,8181,8187,8178,8183,8198,8172,8192,8188,8194,8179,8170,8190,&school_level=&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; }