function addMarkers() { mySelect = document.getElementById('selection'); Stuart = [];Hobe_Sound = [];Palm_City = [];Jensen_Beach = [];Indiantown = [];Okeechobee = [];mySelect.options[mySelect.options.length] = new Option("Hobe Sound schools",'all=Hobe_Sound'); mySelect.options[mySelect.options.length] = new Option("Indiantown schools",'all=Indiantown'); mySelect.options[mySelect.options.length] = new Option("Jensen Beach schools",'all=Jensen_Beach'); mySelect.options[mySelect.options.length] = new Option("Okeechobee schools",'all=Okeechobee'); mySelect.options[mySelect.options.length] = new Option("Palm City schools",'all=Palm_City'); mySelect.options[mySelect.options.length] = new Option("Stuart schools",'all=Stuart'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Stuart[Stuart.length] = createMarker(new GPoint(-80.24154663,27.17546272),"
Alternative Education Boot Camp
800 Se Monterey Road
Stuart, FL 34994

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alternative Education Boot Camp",'Stuart=' + Stuart.length); Hobe_Sound[Hobe_Sound.length] = createMarker(new GPoint(-80.10330200,27.01053810),"
Alternative Education Stop Camp
16450 Se Federal Highway
Hobe Sound, FL 33455

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alternative Education Stop Camp",'Hobe_Sound=' + Hobe_Sound.length); Palm_City[Palm_City.length] = createMarker(new GPoint(-80.27754211,27.17656326),"
Bessey Creek Elementary School
2201 Sw Matheson Avenue
Palm City, FL 34990

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bessey Creek Elementary School",'Palm_City=' + Palm_City.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.23152924,27.14420319),"
Challenger School
5150 Se Willoughby Boulev
Stuart, FL 34997

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Challenger School",'Stuart=' + Stuart.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.22329800,27.13543400),"
Clark Advanced Learning Center
2400 Salerno Road
Stuart, FL 34997

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clark Advanced Learning Center",'Stuart=' + Stuart.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.28337860,27.08820343),"
Crystal Lake Elementary School
2095 Sw 96th Street
Stuart, FL 34997

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Crystal Lake Elementary School",'Stuart=' + Stuart.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.24723816,27.19750023),"
Ese Homebound
5oo E Ocean Boulevard
Stuart, FL 34994

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ese Homebound",'Stuart=' + Stuart.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.25557900,27.20019000),"
Family Learning Centers
500 E Ocean Boulevard
Stuart, FL 34994

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Family Learning Centers",'Stuart=' + Stuart.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.25851440,27.22241783),"
Felix A. Williams Elementary School
401 Nw Baker Road
Stuart, FL 34994

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Felix A. Williams Elementary School",'Stuart=' + Stuart.length); Palm_City[Palm_City.length] = createMarker(new GPoint(-80.29365540,27.16143608),"
Hidden Oaks Middle School
2801 Sw Martin Highway
Palm City, FL 34990

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hidden Oaks Middle School",'Palm_City=' + Palm_City.length); Hobe_Sound[Hobe_Sound.length] = createMarker(new GPoint(-80.12922668,27.06342506),"
Hobe Sound Elementary School
11555 Se Gomez Avenue
Hobe Sound, FL 33455

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hobe Sound Elementary School",'Hobe_Sound=' + Hobe_Sound.length); Jensen_Beach[Jensen_Beach.length] = createMarker(new GPoint(-80.23432300,27.24434800),"
Hope Charter Center
1400 Jensen Beach Blvd
Jensen Beach, FL 34957

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hope Charter Center",'Jensen_Beach=' + Jensen_Beach.length); Indiantown[Indiantown.length] = createMarker(new GPoint(-80.47592926,27.02006531),"
Indiantown Middle School
16303 Sw Farm Road
Indiantown, FL 34956

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Indiantown Middle School",'Indiantown=' + Indiantown.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.24504852,27.19746208),"
Infant-toddlers Exceptional Ed Elementary School
500 E Ocean Boulevard
Stuart, FL 34995

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Infant-toddlers Exceptional Ed Elementary School",'Stuart=' + Stuart.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.24504852,27.19746208),"
Infant-toddlers Exceptional Education Elementary School
500 East Ocean Boulevard
Stuart, FL 34995

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Infant-toddlers Exceptional Education Elementary School",'Stuart=' + Stuart.length); Jensen_Beach[Jensen_Beach.length] = createMarker(new GPoint(-80.23624420,27.23599625),"
Jensen Beach Elementary School
2525 Ne Savannah Road
Jensen Beach, FL 34957

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jensen Beach Elementary School",'Jensen_Beach=' + Jensen_Beach.length); Jensen_Beach[Jensen_Beach.length] = createMarker(new GPoint(-80.26748400,27.23900700),"
Jensen Beach High School
2875 Nw Goldenrod Road
Jensen Beach, FL 34957

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jensen Beach High School",'Jensen_Beach=' + Jensen_Beach.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.23442841,27.19006348),"
Julian D. Parker Elementary School
1050 E 10th Street
Stuart, FL 34996

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Julian D. Parker Elementary School",'Stuart=' + Stuart.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.25170135,27.17070770),"
Martin County High School
2801 S Kanner Highway
Stuart, FL 34994

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Martin County High School",'Stuart=' + Stuart.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.25557900,27.20019000),"
Martin County Superintendent's Office
0500 E Ocean Boulevard
Stuart, FL 34994

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Martin County Superintendent's Office",'Stuart=' + Stuart.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.24471000,27.19281500),"
Martin County Transition School
615 Se Lake Street
Stuart, FL 34994

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Martin County Transition School",'Stuart=' + Stuart.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.19399261,27.13543129),"
Murray Middle School
4400 Se Murray Street
Stuart, FL 34997

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Murray Middle School",'Stuart=' + Stuart.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.82617950,27.30597305),"
Okeechobee Boys School
7202 Highway 441 N
Okeechobee, FL 34972

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Okeechobee Boys School",'Okeechobee=' + Okeechobee.length); Palm_City[Palm_City.length] = createMarker(new GPoint(-80.27923584,27.16431046),"
Palm City Elementary School
1951 Sw 34th Street
Palm City, FL 34990

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Palm City Elementary School",'Palm_City=' + Palm_City.length); Indiantown[Indiantown.length] = createMarker(new GPoint(-80.48030090,27.03249931),"
Parent Resource Center
P.o. Box 836
Indiantown, FL 34956

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Parent Resource Center",'Indiantown=' + Indiantown.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.23133850,27.14184952),"
Pinewood Elementary School
5200 Se Willoughby Boulev
Stuart, FL 34997

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pinewood Elementary School",'Stuart=' + Stuart.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.20082855,27.14409447),"
Pk Early Intervention Elementary School
3940 Se Salerno Road
Stuart, FL 34997

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pk Early Intervention Elementary School",'Stuart=' + Stuart.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.20725250,27.14495850),"
Port Salerno Elementary School
3260 Se Lionel Terrace
Stuart, FL 34997

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Port Salerno Elementary School",'Stuart=' + Stuart.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.20082855,27.14409447),"
Prekindergarten Programs
3940 Se Salerno Road
Stuart, FL 34997

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Prekindergarten Programs",'Stuart=' + Stuart.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.24504852,27.19746208),"
Sandy Pines Psychiatric Center
500 E Ocean Boulevard
Stuart, FL 34994

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sandy Pines Psychiatric Center",'Stuart=' + Stuart.length); Hobe_Sound[Hobe_Sound.length] = createMarker(new GPoint(-80.20348358,27.09965134),"
Sea Wind Elementary School
3700 Se Seabranch Bouleva
Hobe Sound, FL 33455

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sea Wind Elementary School",'Hobe_Sound=' + Hobe_Sound.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.26285553,27.07455254),"
South Fork High School
10205 Sw Pratt Whitney Ro
Stuart, FL 34997

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Fork High School",'Stuart=' + Stuart.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.24275208,27.19266319),"
Specenterum Junior/senior High School
800 Bahama Avenue
Stuart, FL 34994

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Specenterum Junior/senior High School",'Stuart=' + Stuart.length); Stuart[Stuart.length] = createMarker(new GPoint(-80.24694824,27.19498825),"
Stuart Middle School
575 Georgia Avenue
Stuart, FL 34994

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Stuart Middle School",'Stuart=' + Stuart.length); Indiantown[Indiantown.length] = createMarker(new GPoint(-80.46163177,27.02189255),"
Warfield Elementary School
15261 Sw 150th Street
Indiantown, FL 34956

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Warfield Elementary School",'Indiantown=' + Indiantown.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,10); /* 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(Hobe_Sound); map.removeOverlays(Indiantown); map.removeOverlays(Jensen_Beach); map.removeOverlays(Okeechobee); map.removeOverlays(Palm_City); map.removeOverlays(Stuart); 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(Stuart);map.removeOverlays(Hobe_Sound); map.removeOverlays(Indiantown); map.removeOverlays(Jensen_Beach); map.removeOverlays(Okeechobee); map.removeOverlays(Palm_City); map.removeOverlays(Stuart); map.addOverlays(Hobe_Sound); centerByArray(Hobe_Sound, false, false); cntMarker += Hobe_Sound.length; map.addOverlays(Indiantown); centerByArray(Indiantown, false, false); cntMarker += Indiantown.length; map.addOverlays(Jensen_Beach); centerByArray(Jensen_Beach, false, false); cntMarker += Jensen_Beach.length; map.addOverlays(Okeechobee); centerByArray(Okeechobee, false, false); cntMarker += Okeechobee.length; map.addOverlays(Palm_City); centerByArray(Palm_City, false, false); cntMarker += Palm_City.length; map.addOverlays(Stuart); centerByArray(Stuart, false, false); cntMarker += Stuart.length; centerByArray(Stuart,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'); } }