function addMarkers(){ mySelect = document.getElementById('selection'); Waianae = [];Honolulu = [];Hilo = [];Wahiawa = [];Kapolei = [];Kahului = [];Makawao = [];Kailua = [];Ewa_Beach = [];Kamuela = [];Wailuku = [];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("Kamuela schools",'all=Kamuela'); mySelect.options[mySelect.options.length] = new Option("Kapolei schools",'all=Kapolei'); mySelect.options[mySelect.options.length] = new Option("Makawao schools",'all=Makawao'); mySelect.options[mySelect.options.length] = new Option("Wahiawa schools",'all=Wahiawa'); mySelect.options[mySelect.options.length] = new Option("Waianae schools",'all=Waianae'); mySelect.options[mySelect.options.length] = new Option("Wailuku schools",'all=Wailuku'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Waianae[Waianae.length] = createMarker(new GPoint(-158.18532300,21.43763900),"
Adventist Malama Elementary School
86-072 Farrington Highway
Waianae, HI 96792
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Adventist Malama Elementary School",'Waianae=' + Waianae.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.93427200,21.33928500),"
Assets School
1 Ohana Nui Way
Honolulu, HI 96818
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Assets School",'Honolulu=' + Honolulu.length); Hilo[Hilo.length] = createMarker(new GPoint(-155.08854100,19.72204900),"
Haili Christian School
190 Ululani Street
Hilo, HI 96720
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Haili Christian School",'Hilo=' + Hilo.length); Hilo[Hilo.length] = createMarker(new GPoint(-155.10597100,19.67644100),"
Hale Aloha Nazarene School
595 Kupulau Road
Hilo, HI 96720
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hale Aloha Nazarene School",'Hilo=' + Hilo.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.85184600,21.32152200),"
Hawaii Baptist Academy - Elementary School
21 Bates Street
Honolulu, HI 96817
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hawaii Baptist Academy - Elementary School",'Honolulu=' + Honolulu.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.84373700,21.30492700),"
Hawaiian Mission Academy
1438 Pensacola Street
Honolulu, HI 96822
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hawaiian Mission Academy",'Honolulu=' + Honolulu.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.83699900,21.30159900),"
Hawaiian Mission Elementary & Intermediate School
1415 Makiki Street
Honolulu, HI 96814
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hawaiian Mission Elementary & Intermediate School",'Honolulu=' + Honolulu.length); Wahiawa[Wahiawa.length] = createMarker(new GPoint(-158.02273800,21.49863300),"
Ho'ala School
1067 California Avenue A
Wahiawa, HI 96786
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ho'ala School",'Wahiawa=' + Wahiawa.length); Kapolei[Kapolei.length] = createMarker(new GPoint(-158.07970900,21.33461000),"
Island Pacific Academy
909 Haumea Street
Kapolei, HI 96707
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Island Pacific Academy",'Kapolei=' + Kapolei.length); Kahului[Kahului.length] = createMarker(new GPoint(-156.45904400,20.87411400),"
Ka'ahumanu Hou Christian School
777 Mokulele Hwy
Kahului, HI 96732
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ka'ahumanu Hou Christian School",'Kahului=' + Kahului.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.85677600,21.33776300),"
Kamehameha Schools Kapalama Campus
1887 Makuakane Street
Honolulu, HI 96817
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kamehameha Schools Kapalama Campus",'Honolulu=' + Honolulu.length); Makawao[Makawao.length] = createMarker(new GPoint(-156.33558700,20.82285700),"
Kamehameha Schools Maui Campus
275 Aapueo Parkway
Makawao, HI 96768
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kamehameha Schools Maui Campus",'Makawao=' + Makawao.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.81721900,21.26038300),"
La Pietra Hawaii School For Girls
2933 Poni Moi Road
Honolulu, HI 96815
All-girls school, 6-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("La Pietra Hawaii School For Girls",'Honolulu=' + Honolulu.length); Kailua[Kailua.length] = createMarker(new GPoint(-157.76839200,21.37740300),"
Le Jardin Academy
917 Kalanianaole Highway
Kailua, HI 96734
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Le Jardin Academy",'Kailua=' + Kailua.length); Kahului[Kahului.length] = createMarker(new GPoint(-156.46435000,20.88512800),"
Maui Adventist School
261 S Puunene Avenue
Kahului, HI 96732
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Maui Adventist School",'Kahului=' + Kahului.length); Ewa_Beach[Ewa_Beach.length] = createMarker(new GPoint(-158.01780000,21.33790000),"
Messiah Lutheran School
91-679 Fort Weaver Road
Ewa Beach, HI 96706
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Messiah Lutheran School",'Ewa_Beach=' + Ewa_Beach.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.81860300,21.30344700),"
Mid-pacific Institute
2445 Kaala Street
Honolulu, HI 96822
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mid-pacific Institute",'Honolulu=' + Honolulu.length); Makawao[Makawao.length] = createMarker(new GPoint(-156.32263400,20.86950300),"
Montessori School Of Maui
2933 Baldwin Avenue
Makawao, HI 96768
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori School Of Maui",'Makawao=' + Makawao.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); Kamuela[Kamuela.length] = createMarker(new GPoint(-155.67002100,20.02200100),"
Parker School
65-1224 Lindsey Road
Kamuela, HI 96743
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Parker School",'Kamuela=' + Kamuela.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); Hilo[Hilo.length] = createMarker(new GPoint(-155.08354500,19.71398500),"
St. Joseph Elementary School
999 Ululani Street
Hilo, HI 96720
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Joseph Elementary School",'Hilo=' + Hilo.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); 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); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.93608800,21.34028200),"
Samuel Mac Smith Christian School
515 Main Street
Honolulu, HI 96818
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Samuel Mac Smith Christian School",'Honolulu=' + Honolulu.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.85873800,21.30325100),"
Word Of Life Academy
550 Queen Street
Honolulu, HI 96813
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Word Of Life Academy",'Honolulu=' + Honolulu.length); map.removeOverlays(Ewa_Beach); map.removeOverlays(Hilo); map.removeOverlays(Honolulu); map.removeOverlays(Kahului); map.removeOverlays(Kailua); map.removeOverlays(Kamuela); map.removeOverlays(Kapolei); map.removeOverlays(Makawao); map.removeOverlays(Wahiawa); map.removeOverlays(Waianae); map.removeOverlays(Wailuku); 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(Kamuela)},1000); setTimeout(function(){map.addOverlays(Kapolei)},1000); setTimeout(function(){map.addOverlays(Makawao)},1000); setTimeout(function(){map.addOverlays(Wahiawa)},1000); setTimeout(function(){map.addOverlays(Waianae)},1000); setTimeout(function(){map.addOverlays(Wailuku)},1000); maxLng = -155.08354500; maxLat = 21.49863300; minLng = -158.18532300; minLat = 19.67644100; 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(Ewa_Beach); map.removeOverlays(Hilo); map.removeOverlays(Honolulu); map.removeOverlays(Kahului); map.removeOverlays(Kailua); map.removeOverlays(Kamuela); map.removeOverlays(Kapolei); map.removeOverlays(Makawao); map.removeOverlays(Wahiawa); map.removeOverlays(Waianae); map.removeOverlays(Wailuku); 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(Waianae);map.removeOverlays(Ewa_Beach); map.removeOverlays(Hilo); map.removeOverlays(Honolulu); map.removeOverlays(Kahului); map.removeOverlays(Kailua); map.removeOverlays(Kamuela); map.removeOverlays(Kapolei); map.removeOverlays(Makawao); map.removeOverlays(Wahiawa); map.removeOverlays(Waianae); map.removeOverlays(Wailuku); 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(Kamuela); centerByArray(Kamuela, false, false); cntMarker += Kamuela.length; map.addOverlays(Kapolei); centerByArray(Kapolei, false, false); cntMarker += Kapolei.length; map.addOverlays(Makawao); centerByArray(Makawao, false, false); cntMarker += Makawao.length; map.addOverlays(Wahiawa); centerByArray(Wahiawa, false, false); cntMarker += Wahiawa.length; map.addOverlays(Waianae); centerByArray(Waianae, false, false); cntMarker += Waianae.length; map.addOverlays(Wailuku); centerByArray(Wailuku, false, false); cntMarker += Wailuku.length; centerByArray(Waianae,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,35934,8105,8123,8137,8152,8173,8213,8118,8138,8166,35631,8124,8107,8151,8162,8097,8098,8189,35934,35632,8106,8123,8137,8152,8173,8197,35634,8213,8118,8149,8138,8166,35631,8124,8158,8107,8081,8179,/all'); //window.open('/map.php?type=2&schools=8191,35934,8105,8123,8137,8152,8173,8213,8118,8138,8166,35631,8124,8107,8151,8162,8097,8098,8189,35934,35632,8106,8123,8137,8152,8173,8197,35634,8213,8118,8149,8138,8166,35631,8124,8158,8107,8081,8179,&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; }