function addMarkers(){ mySelect = document.getElementById('selection'); Honolulu = [];Paia = [];Aiea = [];Hilo = [];Kahului = [];Kailua = [];Kailua_Kona = [];Waipahu = [];Holualoa = [];Hoolehua = [];Haleiwa = [];Kaneohe = [];mySelect.options[mySelect.options.length] = new Option("Aiea schools",'all=Aiea'); mySelect.options[mySelect.options.length] = new Option("Haleiwa schools",'all=Haleiwa'); mySelect.options[mySelect.options.length] = new Option("Hilo schools",'all=Hilo'); mySelect.options[mySelect.options.length] = new Option("Holualoa schools",'all=Holualoa'); mySelect.options[mySelect.options.length] = new Option("Honolulu schools",'all=Honolulu'); mySelect.options[mySelect.options.length] = new Option("Hoolehua schools",'all=Hoolehua'); 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("Kailua Kona schools",'all=Kailua_Kona'); mySelect.options[mySelect.options.length] = new Option("Kaneohe schools",'all=Kaneohe'); mySelect.options[mySelect.options.length] = new Option("Paia schools",'all=Paia'); 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.83404600,21.29838500),"
Central Union Preschool And Ki
1660 S Beretania St
Honolulu, HI 96826
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Union Preschool And Ki",'Honolulu=' + Honolulu.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.90253800,21.36516200),"
Christian Academy
3400 Moanalua Rd
Honolulu, HI 96819
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Academy",'Honolulu=' + Honolulu.length); Paia[Paia.length] = createMarker(new GPoint(-156.37179000,20.90329500),"
Doris Todd Memorial Christian School
519 Baldwin Avenue
Paia, HI 96779
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Doris Todd Memorial Christian School",'Paia=' + Paia.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.85847000,21.32535600),"
Good Shepherd Preschool
638 North Kuakini Street
Honolulu, HI 96817
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Good Shepherd Preschool",'Honolulu=' + Honolulu.length); Aiea[Aiea.length] = createMarker(new GPoint(-157.91386600,21.37224000),"
Grace Christian Academy
99-833 Iwaena Street
Aiea, HI 96701
Co-ed school, PK-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Christian Academy",'Aiea=' + Aiea.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); 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); Kailua[Kailua.length] = createMarker(new GPoint(-157.74480000,21.40500000),"
Kailua Christian Academy
1110a Kailua Road
Kailua, HI 96734
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kailua Christian Academy",'Kailua=' + Kailua.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.79847100,21.28084300),"
Kaimuki Christian School
1117 Koko Head Ave
Honolulu, HI 96816
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kaimuki Christian School",'Honolulu=' + Honolulu.length); Kailua_Kona[Kailua_Kona.length] = createMarker(new GPoint(-155.73190000,19.92210000),"
Kona Christian Academy
74-4907 Palani Road
Kailua Kona, HI 96740
Co-ed school, K-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kona Christian Academy",'Kailua_Kona=' + Kailua_Kona.length); Waipahu[Waipahu.length] = createMarker(new GPoint(-158.00028200,21.39341400),"
Lanakila Baptist Elementary School
94-1250 Waipahu Street
Waipahu, HI 96797
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lanakila Baptist Elementary School",'Waipahu=' + Waipahu.length); Holualoa[Holualoa.length] = createMarker(new GPoint(-155.96948600,19.67930300),"
Makua Lani Christian School
74-4947 Mamalahoa Highway
Holualoa, HI 96725
Co-ed school, 8-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Makua Lani Christian School",'Holualoa=' + Holualoa.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); Hoolehua[Hoolehua.length] = createMarker(new GPoint(-157.09150000,21.16210000),"
Molokai Christian Academy
Pob 555
Hoolehua, HI 96729
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Molokai Christian Academy",'Hoolehua=' + Hoolehua.length); Waipahu[Waipahu.length] = createMarker(new GPoint(-157.99889200,21.41124600),"
Pearl Harbor Christian Academy
94-1044 Waipio Uka Street
Waipahu, HI 96797
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pearl Harbor Christian Academy",'Waipahu=' + Waipahu.length); Haleiwa[Haleiwa.length] = createMarker(new GPoint(-158.05885300,21.65559700),"
Sunset Beach Christian School
59-578 Kamehameha Highway
Haleiwa, HI 96712
Co-ed school, KG-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sunset Beach Christian School",'Haleiwa=' + Haleiwa.length); Kailua[Kailua.length] = createMarker(new GPoint(-157.76390900,21.37570900),"
Trinity Christian School
875 Auloa Road
Kailua, HI 96734
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Christian School",'Kailua=' + Kailua.length); Kailua_Kona[Kailua_Kona.length] = createMarker(new GPoint(-155.98647400,19.63104000),"
University Of The Nations Preschool
75-5851 Kuakini Highway 228
Kailua Kona, HI 96740
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("University Of The Nations Preschool",'Kailua_Kona=' + Kailua_Kona.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.85256300,21.32546800),"
Waolani Judd Nazarene School
408 N Judd Street
Honolulu, HI 96817
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Waolani Judd Nazarene School",'Honolulu=' + Honolulu.length); Kaneohe[Kaneohe.length] = createMarker(new GPoint(-157.80648100,21.41791300),"
Windward Nazarene Academy
45-232 Puaae Rd Pob 1633
Kaneohe, HI 96744
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Windward Nazarene Academy",'Kaneohe=' + Kaneohe.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(Aiea); map.removeOverlays(Haleiwa); map.removeOverlays(Hilo); map.removeOverlays(Holualoa); map.removeOverlays(Honolulu); map.removeOverlays(Hoolehua); map.removeOverlays(Kahului); map.removeOverlays(Kailua); map.removeOverlays(Kailua_Kona); map.removeOverlays(Kaneohe); map.removeOverlays(Paia); map.removeOverlays(Waipahu); setTimeout(function(){map.addOverlays(Aiea)},1000); setTimeout(function(){map.addOverlays(Haleiwa)},1000); setTimeout(function(){map.addOverlays(Hilo)},1000); setTimeout(function(){map.addOverlays(Holualoa)},1000); setTimeout(function(){map.addOverlays(Honolulu)},1000); setTimeout(function(){map.addOverlays(Hoolehua)},1000); setTimeout(function(){map.addOverlays(Kahului)},1000); setTimeout(function(){map.addOverlays(Kailua)},1000); setTimeout(function(){map.addOverlays(Kailua_Kona)},1000); setTimeout(function(){map.addOverlays(Kaneohe)},1000); setTimeout(function(){map.addOverlays(Paia)},1000); setTimeout(function(){map.addOverlays(Waipahu)},1000); maxLng = -155.08854100; maxLat = 21.65559700; minLng = -158.05885300; minLat = 19.63104000; 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(Haleiwa); map.removeOverlays(Hilo); map.removeOverlays(Holualoa); map.removeOverlays(Honolulu); map.removeOverlays(Hoolehua); map.removeOverlays(Kahului); map.removeOverlays(Kailua); map.removeOverlays(Kailua_Kona); map.removeOverlays(Kaneohe); map.removeOverlays(Paia); 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(Haleiwa); map.removeOverlays(Hilo); map.removeOverlays(Holualoa); map.removeOverlays(Honolulu); map.removeOverlays(Hoolehua); map.removeOverlays(Kahului); map.removeOverlays(Kailua); map.removeOverlays(Kailua_Kona); map.removeOverlays(Kaneohe); map.removeOverlays(Paia); map.removeOverlays(Waipahu); map.addOverlays(Aiea); centerByArray(Aiea, false, false); cntMarker += Aiea.length; map.addOverlays(Haleiwa); centerByArray(Haleiwa, false, false); cntMarker += Haleiwa.length; map.addOverlays(Hilo); centerByArray(Hilo, false, false); cntMarker += Hilo.length; map.addOverlays(Holualoa); centerByArray(Holualoa, false, false); cntMarker += Holualoa.length; map.addOverlays(Honolulu); centerByArray(Honolulu, false, false); cntMarker += Honolulu.length; map.addOverlays(Hoolehua); centerByArray(Hoolehua, false, false); cntMarker += Hoolehua.length; map.addOverlays(Kahului); centerByArray(Kahului, false, false); cntMarker += Kahului.length; map.addOverlays(Kailua); centerByArray(Kailua, false, false); cntMarker += Kailua.length; map.addOverlays(Kailua_Kona); centerByArray(Kailua_Kona, false, false); cntMarker += Kailua_Kona.length; map.addOverlays(Kaneohe); centerByArray(Kaneohe, false, false); cntMarker += Kaneohe.length; map.addOverlays(Paia); centerByArray(Paia, false, false); cntMarker += Paia.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///8096,8143,8087,8213,8153,8118,8120,8096,8202,8097,8098,8084,8087,35021,8121,8210,8213,8153,8118,8149,8120,8204,8129,34748,8212,8091,8136,33506,/all'); //window.open('/map.php?type=2&schools=8096,8143,8087,8213,8153,8118,8120,8096,8202,8097,8098,8084,8087,35021,8121,8210,8213,8153,8118,8149,8120,8204,8129,34748,8212,8091,8136,33506,&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; }