function addMarkers() { mySelect = document.getElementById('selection'); Punta_Gorda = [];Port_Charlotte = [];Rotonda_West = [];Englewood = [];Charlotte_Harbor = [];mySelect.options[mySelect.options.length] = new Option("Charlotte Harbor schools",'all=Charlotte_Harbor'); mySelect.options[mySelect.options.length] = new Option("Englewood schools",'all=Englewood'); mySelect.options[mySelect.options.length] = new Option("Port Charlotte schools",'all=Port_Charlotte'); mySelect.options[mySelect.options.length] = new Option("Punta Gorda schools",'all=Punta_Gorda'); mySelect.options[mySelect.options.length] = new Option("Rotonda West schools",'all=Rotonda_West'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Punta_Gorda[Punta_Gorda.length] = createMarker(new GPoint(-82.04455566,26.93441391),"
Baker/head Start Elementary School
311 E Charlotte Avenue
Punta Gorda, FL 33950

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Baker/head Start Elementary School",'Punta_Gorda=' + Punta_Gorda.length); Port_Charlotte[Port_Charlotte.length] = createMarker(new GPoint(-82.14864900,26.98467500),"
Charlotte County Superintendent's Office
81445 Education Way
Port Charlotte, FL 33948

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Charlotte County Superintendent's Office",'Port_Charlotte=' + Port_Charlotte.length); Port_Charlotte[Port_Charlotte.length] = createMarker(new GPoint(-82.07427216,26.96837997),"
Charlotte Harbor School
22450 Hancock Avenue
Port Charlotte, FL 33980

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Charlotte Harbor School",'Port_Charlotte=' + Port_Charlotte.length); Punta_Gorda[Punta_Gorda.length] = createMarker(new GPoint(-82.03954315,26.92898369),"
Charlotte High School
1250 Cooper Street
Punta Gorda, FL 33950

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Charlotte High School",'Punta_Gorda=' + Punta_Gorda.length); Port_Charlotte[Port_Charlotte.length] = createMarker(new GPoint(-82.14686584,27.00354958),"
Charlotte Technical Center
18300 Toledo Blade Boulev
Port Charlotte, FL 33948

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Charlotte Technical Center",'Port_Charlotte=' + Port_Charlotte.length); Punta_Gorda[Punta_Gorda.length] = createMarker(new GPoint(-81.69380951,26.94538879),"
Crossenioroads Wilderness Institute
45991 Bermont Road
Punta Gorda, FL 33982

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Crossenioroads Wilderness Institute",'Punta_Gorda=' + Punta_Gorda.length); Punta_Gorda[Punta_Gorda.length] = createMarker(new GPoint(-82.01510620,26.98483658),"
Deep Creek Elementary School
26900 Harborview Road
Punta Gorda, FL 33983

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Deep Creek Elementary School",'Punta_Gorda=' + Punta_Gorda.length); Punta_Gorda[Punta_Gorda.length] = createMarker(new GPoint(-82.02579498,26.90735626),"
Eagle Vision
2208 Castilla Avenue
Punta Gorda, FL 33950

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eagle Vision",'Punta_Gorda=' + Punta_Gorda.length); Punta_Gorda[Punta_Gorda.length] = createMarker(new GPoint(-82.00353241,26.94000435),"
East Elementary School
27050 Fairway Drive
Punta Gorda, FL 33982

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Elementary School",'Punta_Gorda=' + Punta_Gorda.length); Punta_Gorda[Punta_Gorda.length] = createMarker(new GPoint(-82.02579498,26.90735626),"
Kelly Hall High School
2208 Castilla Avenue
Punta Gorda, FL 33950

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kelly Hall High School",'Punta_Gorda=' + Punta_Gorda.length); Port_Charlotte[Port_Charlotte.length] = createMarker(new GPoint(-82.06665802,27.01017761),"
Kingsway Elementary School
23300 Quasar Boulevard
Port Charlotte, FL 33952

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kingsway Elementary School",'Port_Charlotte=' + Port_Charlotte.length); Rotonda_West[Rotonda_West.length] = createMarker(new GPoint(-82.28977966,26.91279411),"
L. A. Ainger Middle School
245 Cougar Way
Rotonda West, FL 33947

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("L. A. Ainger Middle School",'Rotonda_West=' + Rotonda_West.length); Englewood[Englewood.length] = createMarker(new GPoint(-82.33572388,26.92815208),"
Lemon Bay High School
2201 Placida Road
Englewood, FL 34224

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lemon Bay High School",'Englewood=' + Englewood.length); Port_Charlotte[Port_Charlotte.length] = createMarker(new GPoint(-82.11318207,27.02175713),"
Liberty Elementary School
370 Atwater Street
Port Charlotte, FL 33954

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Liberty Elementary School",'Port_Charlotte=' + Port_Charlotte.length); Port_Charlotte[Port_Charlotte.length] = createMarker(new GPoint(-82.12335205,26.98516464),"
Meadow Park Elementary School
3131 Lake View Boulevard
Port Charlotte, FL 33948

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Meadow Park Elementary School",'Port_Charlotte=' + Port_Charlotte.length); Port_Charlotte[Port_Charlotte.length] = createMarker(new GPoint(-82.14461800,27.00642600),"
Migrant Non-enrolled Students
1445 Education Way
Port Charlotte, FL 33948

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Migrant Non-enrolled Students",'Port_Charlotte=' + Port_Charlotte.length); Port_Charlotte[Port_Charlotte.length] = createMarker(new GPoint(-82.16195679,27.00326347),"
Murdock Middle School
17325 Mariner Way
Port Charlotte, FL 33948

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Murdock Middle School",'Port_Charlotte=' + Port_Charlotte.length); Port_Charlotte[Port_Charlotte.length] = createMarker(new GPoint(-82.24237823,26.94325638),"
Myakka River Elementary School
12650 Willmington Bouleva
Port Charlotte, FL 33981

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Myakka River Elementary School",'Port_Charlotte=' + Port_Charlotte.length); Port_Charlotte[Port_Charlotte.length] = createMarker(new GPoint(-82.08743286,27.00274467),"
Neil Armstrong Elementary School
22100 Breezeswept Avenue
Port Charlotte, FL 33952

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Neil Armstrong Elementary School",'Port_Charlotte=' + Port_Charlotte.length); Port_Charlotte[Port_Charlotte.length] = createMarker(new GPoint(-82.17256800,26.99613700),"
New Challenge School Of Charlotte County
16529 Joppa Avenue
Port Charlotte, FL 33948

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Challenge School Of Charlotte County",'Port_Charlotte=' + Port_Charlotte.length); Charlotte_Harbor[Charlotte_Harbor.length] = createMarker(new GPoint(-82.07672119,26.96832466),"
Peace River Elementary School
22400 Nw Hancock Avenue
Charlotte Harbor, FL 33980

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Peace River Elementary School",'Charlotte_Harbor=' + Charlotte_Harbor.length); Port_Charlotte[Port_Charlotte.length] = createMarker(new GPoint(-82.15188599,27.00334358),"
Port Charlotte High School
18200 Toledo Blade Boulev
Port Charlotte, FL 33948

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Port Charlotte High School",'Port_Charlotte=' + Port_Charlotte.length); Port_Charlotte[Port_Charlotte.length] = createMarker(new GPoint(-82.07741547,26.99946213),"
Port Charlotte Middle School
23000 Midway Boulevard
Port Charlotte, FL 33952

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Port Charlotte Middle School",'Port_Charlotte=' + Port_Charlotte.length); Punta_Gorda[Punta_Gorda.length] = createMarker(new GPoint(-82.03799438,26.92984390),"
Punta Gorda Middle School
825 Carmalita Street
Punta Gorda, FL 33950

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Punta Gorda Middle School",'Punta_Gorda=' + Punta_Gorda.length); Punta_Gorda[Punta_Gorda.length] = createMarker(new GPoint(-82.03954315,26.92927361),"
Sallie Jones Elementary School
1230 Narranja Street
Punta Gorda, FL 33950

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sallie Jones Elementary School",'Punta_Gorda=' + Punta_Gorda.length); Rotonda_West[Rotonda_West.length] = createMarker(new GPoint(-82.28273010,26.91128731),"
Vineland Elementary School
467 Boundary Boulevard
Rotonda West, FL 33947

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Vineland Elementary School",'Rotonda_West=' + Rotonda_West.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(Charlotte_Harbor); map.removeOverlays(Englewood); map.removeOverlays(Port_Charlotte); map.removeOverlays(Punta_Gorda); map.removeOverlays(Rotonda_West); 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(Punta_Gorda);map.removeOverlays(Charlotte_Harbor); map.removeOverlays(Englewood); map.removeOverlays(Port_Charlotte); map.removeOverlays(Punta_Gorda); map.removeOverlays(Rotonda_West); map.addOverlays(Charlotte_Harbor); centerByArray(Charlotte_Harbor, false, false); cntMarker += Charlotte_Harbor.length; map.addOverlays(Englewood); centerByArray(Englewood, false, false); cntMarker += Englewood.length; map.addOverlays(Port_Charlotte); centerByArray(Port_Charlotte, false, false); cntMarker += Port_Charlotte.length; map.addOverlays(Punta_Gorda); centerByArray(Punta_Gorda, false, false); cntMarker += Punta_Gorda.length; map.addOverlays(Rotonda_West); centerByArray(Rotonda_West, false, false); cntMarker += Rotonda_West.length; centerByArray(Punta_Gorda,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'); } }