function addMarkers(){ mySelect = document.getElementById('selection'); Honolulu = [];Ewa_Beach = [];Kula = [];Kailua_Kona = [];Kamuela = [];Wahiawa = [];Haiku = [];Kapolei = [];Lihue = [];Kilauea = [];Kealakekua = [];Kailua = [];Keaau = [];Pahoa = [];Kihei = [];Makawao = [];mySelect.options[mySelect.options.length] = new Option("Ewa Beach schools",'all=Ewa_Beach'); mySelect.options[mySelect.options.length] = new Option("Haiku schools",'all=Haiku'); mySelect.options[mySelect.options.length] = new Option("Honolulu schools",'all=Honolulu'); 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("Kamuela schools",'all=Kamuela'); mySelect.options[mySelect.options.length] = new Option("Kapolei schools",'all=Kapolei'); mySelect.options[mySelect.options.length] = new Option("Keaau schools",'all=Keaau'); mySelect.options[mySelect.options.length] = new Option("Kealakekua schools",'all=Kealakekua'); mySelect.options[mySelect.options.length] = new Option("Kihei schools",'all=Kihei'); mySelect.options[mySelect.options.length] = new Option("Kilauea schools",'all=Kilauea'); mySelect.options[mySelect.options.length] = new Option("Kula schools",'all=Kula'); mySelect.options[mySelect.options.length] = new Option("Lihue schools",'all=Lihue'); mySelect.options[mySelect.options.length] = new Option("Makawao schools",'all=Makawao'); mySelect.options[mySelect.options.length] = new Option("Pahoa schools",'all=Pahoa'); mySelect.options[mySelect.options.length] = new Option("Wahiawa schools",'all=Wahiawa'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.85489900,21.33172300),"
Academy Of The Pacific
913 Alewa Drive
Honolulu, HI 96817
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Academy Of The Pacific",'Honolulu=' + Honolulu.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); Ewa_Beach[Ewa_Beach.length] = createMarker(new GPoint(-158.02938100,21.35607800),"
Hale O Ulu School
91-1841 Fort Weaver Road
Ewa Beach, HI 96706
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hale O Ulu School",'Ewa_Beach=' + Ewa_Beach.length); Kula[Kula.length] = createMarker(new GPoint(-156.32595600,20.76606900),"
Haleakala Waldorf School
4160 Lower Kula Road
Kula, HI 96790
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Haleakala Waldorf School",'Kula=' + Kula.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.83166800,21.30723200),"
Hanahauoli School
1922 Makiki Street
Honolulu, HI 96822
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hanahauoli School",'Honolulu=' + Honolulu.length); Kailua_Kona[Kailua_Kona.length] = createMarker(new GPoint(-155.98591700,19.67513800),"
Hawaii Montessori School At Kona
74-978 Manawalea Street
Kailua Kona, HI 96740
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hawaii Montessori School At Kona",'Kailua_Kona=' + Kailua_Kona.length); Kamuela[Kamuela.length] = createMarker(new GPoint(-155.70078400,20.02930500),"
Hawaii Preparatory Academy
65-1692 Kohala Mountain Rd
Kamuela, HI 96743
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hawaii Preparatory Academy",'Kamuela=' + Kamuela.length); Kamuela[Kamuela.length] = createMarker(new GPoint(-155.66049000,20.02504600),"
Hawai'i Montessori Schools - Kamuela
64-1058 Mamalahoa Highway 201
Kamuela, HI 96743
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hawai'i Montessori Schools - Kamuela",'Kamuela=' + Kamuela.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); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.73464500,21.28576300),"
Honolulu Waldorf School
350 Ulua Street
Honolulu, HI 96821
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Honolulu Waldorf School",'Honolulu=' + Honolulu.length); Haiku[Haiku.length] = createMarker(new GPoint(-156.28440000,20.90490000),"
Horizons Academy Of Maul Inc
Po Box 1308 740 Haiku Road
Haiku, HI 96708
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Horizons Academy Of Maul Inc",'Haiku=' + Haiku.length); Kailua_Kona[Kailua_Kona.length] = createMarker(new GPoint(-155.98575000,19.67601500),"
Hualalai Academy
74-4966 Kealakaa Street
Kailua Kona, HI 96740
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hualalai Academy",'Kailua_Kona=' + Kailua_Kona.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); Lihue[Lihue.length] = createMarker(new GPoint(-159.39631100,21.96674700),"
Island School
3-1875 Kaumualii Highway
Lihue, HI 96766
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Island School",'Lihue=' + Lihue.length); Kilauea[Kilauea.length] = createMarker(new GPoint(-159.40514100,22.20701400),"
Kaua'i Pacific School
4480 Ho''okui Street
Kilauea, HI 96754
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kaua'i Pacific School",'Kilauea=' + Kilauea.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); Kealakekua[Kealakekua.length] = createMarker(new GPoint(-155.93550000,19.51240000),"
Kona Pacific School
Po Box 447
Kealakekua, HI 96750
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kona Pacific School",'Kealakekua=' + Kealakekua.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); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.84125300,21.30484800),"
Lokahi Montessori School
1506 Piikoi Street
Honolulu, HI 96822
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lokahi Montessori School",'Honolulu=' + Honolulu.length); Keaau[Keaau.length] = createMarker(new GPoint(-154.99670000,19.57770000),"
Malamalama Waldorf School
Hc 3 Box 13068
Keaau, HI 96749
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Malamalama Waldorf School",'Keaau=' + Keaau.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); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.83624800,21.30865900),"
Montessori Community School
1239 Nehoa St
Honolulu, HI 96822
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Community School",'Honolulu=' + Honolulu.length); Pahoa[Pahoa.length] = createMarker(new GPoint(-154.92220000,19.47960000),"
Montessori Country School
Po Box 1203 15-3006 Puna Road
Pahoa, HI 96778
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Country School",'Pahoa=' + Pahoa.length); Kihei[Kihei.length] = createMarker(new GPoint(-156.44640000,20.73080000),"
Montessori Hale O Keiki Inc
Po Box 2348
Kihei, HI 96753
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Hale O Keiki Inc",'Kihei=' + Kihei.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); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.93020700,21.35631700),"
Navy Hale Keiki School
153 Bougainville Drive
Honolulu, HI 96818
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Navy Hale Keiki School",'Honolulu=' + Honolulu.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.83497800,21.30612200),"
Playmate Kindergarten, Day Car
1704 Keeaumoku Street
Honolulu, HI 96822
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Playmate Kindergarten, Day Car",'Honolulu=' + Honolulu.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.83218700,21.30292000),"
Punahou School
1601 Punahou St.
Honolulu, HI 96822
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Punahou School",'Honolulu=' + Honolulu.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.85452300,21.31807700),"
Soto Academy
1708 Nuuanu Avenue
Honolulu, HI 96817
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Soto Academy",'Honolulu=' + Honolulu.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.79469900,21.26372400),"
Variety School Of Hawaii
710 Palekaua Street
Honolulu, HI 96816
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Variety School Of Hawaii",'Honolulu=' + Honolulu.length); Honolulu[Honolulu.length] = createMarker(new GPoint(-157.82500000,21.29160000),"
Varsity International School
2617 South King St., 3-d
Honolulu, HI 96826
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Varsity International School",'Honolulu=' + Honolulu.length); Kamuela[Kamuela.length] = createMarker(new GPoint(-155.70020000,19.96150000),"
Waimea Community Montessori School
Po Box 967
Kamuela, HI 96743
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Waimea Community Montessori School",'Kamuela=' + Kamuela.length); Kamuela[Kamuela.length] = createMarker(new GPoint(-155.67208500,20.02277000),"
Waimea Country School
P.O. Box 399
Kamuela, HI 96743
Co-ed school, KG-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Waimea Country School",'Kamuela=' + Kamuela.length); map.removeOverlays(Ewa_Beach); map.removeOverlays(Haiku); map.removeOverlays(Honolulu); map.removeOverlays(Kailua); map.removeOverlays(Kailua_Kona); map.removeOverlays(Kamuela); map.removeOverlays(Kapolei); map.removeOverlays(Keaau); map.removeOverlays(Kealakekua); map.removeOverlays(Kihei); map.removeOverlays(Kilauea); map.removeOverlays(Kula); map.removeOverlays(Lihue); map.removeOverlays(Makawao); map.removeOverlays(Pahoa); map.removeOverlays(Wahiawa); setTimeout(function(){map.addOverlays(Ewa_Beach)},1000); setTimeout(function(){map.addOverlays(Haiku)},1000); setTimeout(function(){map.addOverlays(Honolulu)},1000); setTimeout(function(){map.addOverlays(Kailua)},1000); setTimeout(function(){map.addOverlays(Kailua_Kona)},1000); setTimeout(function(){map.addOverlays(Kamuela)},1000); setTimeout(function(){map.addOverlays(Kapolei)},1000); setTimeout(function(){map.addOverlays(Keaau)},1000); setTimeout(function(){map.addOverlays(Kealakekua)},1000); setTimeout(function(){map.addOverlays(Kihei)},1000); setTimeout(function(){map.addOverlays(Kilauea)},1000); setTimeout(function(){map.addOverlays(Kula)},1000); setTimeout(function(){map.addOverlays(Lihue)},1000); setTimeout(function(){map.addOverlays(Makawao)},1000); setTimeout(function(){map.addOverlays(Pahoa)},1000); setTimeout(function(){map.addOverlays(Wahiawa)},1000); maxLng = -154.92220000; maxLat = 22.20701400; minLng = -159.40514100; minLat = 19.47960000; 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(Haiku); map.removeOverlays(Honolulu); map.removeOverlays(Kailua); map.removeOverlays(Kailua_Kona); map.removeOverlays(Kamuela); map.removeOverlays(Kapolei); map.removeOverlays(Keaau); map.removeOverlays(Kealakekua); map.removeOverlays(Kihei); map.removeOverlays(Kilauea); map.removeOverlays(Kula); map.removeOverlays(Lihue); map.removeOverlays(Makawao); map.removeOverlays(Pahoa); map.removeOverlays(Wahiawa); 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(Ewa_Beach); map.removeOverlays(Haiku); map.removeOverlays(Honolulu); map.removeOverlays(Kailua); map.removeOverlays(Kailua_Kona); map.removeOverlays(Kamuela); map.removeOverlays(Kapolei); map.removeOverlays(Keaau); map.removeOverlays(Kealakekua); map.removeOverlays(Kihei); map.removeOverlays(Kilauea); map.removeOverlays(Kula); map.removeOverlays(Lihue); map.removeOverlays(Makawao); map.removeOverlays(Pahoa); map.removeOverlays(Wahiawa); map.addOverlays(Ewa_Beach); centerByArray(Ewa_Beach, false, false); cntMarker += Ewa_Beach.length; map.addOverlays(Haiku); centerByArray(Haiku, false, false); cntMarker += Haiku.length; map.addOverlays(Honolulu); centerByArray(Honolulu, false, false); cntMarker += Honolulu.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(Kamuela); centerByArray(Kamuela, false, false); cntMarker += Kamuela.length; map.addOverlays(Kapolei); centerByArray(Kapolei, false, false); cntMarker += Kapolei.length; map.addOverlays(Keaau); centerByArray(Keaau, false, false); cntMarker += Keaau.length; map.addOverlays(Kealakekua); centerByArray(Kealakekua, false, false); cntMarker += Kealakekua.length; map.addOverlays(Kihei); centerByArray(Kihei, false, false); cntMarker += Kihei.length; map.addOverlays(Kilauea); centerByArray(Kilauea, false, false); cntMarker += Kilauea.length; map.addOverlays(Kula); centerByArray(Kula, false, false); cntMarker += Kula.length; map.addOverlays(Lihue); centerByArray(Lihue, false, false); cntMarker += Lihue.length; map.addOverlays(Makawao); centerByArray(Makawao, false, false); cntMarker += Makawao.length; map.addOverlays(Pahoa); centerByArray(Pahoa, false, false); cntMarker += Pahoa.length; map.addOverlays(Wahiawa); centerByArray(Wahiawa, false, false); cntMarker += Wahiawa.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///8099,8114,8080,35934,8113,8137,8152,8168,8206,8207,8138,8115,8104,8166,35631,8117,8107,8114,8080,35934,8101,8113,8137,8140,8152,8155,8159,8167,8168,8176,8206,8138,34560,8115,8129,8104,34747,8166,8209,30561,35631,8144,8130,8157,8089,8100,8117,8158,8156,8107,/all'); //window.open('/map.php?type=2&schools=8099,8114,8080,35934,8113,8137,8152,8168,8206,8207,8138,8115,8104,8166,35631,8117,8107,8114,8080,35934,8101,8113,8137,8140,8152,8155,8159,8167,8168,8176,8206,8138,34560,8115,8129,8104,34747,8166,8209,30561,35631,8144,8130,8157,8089,8100,8117,8158,8156,8107,&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; }