// creates onload event handler window.onload = function () { if ( load ) { load(); } } // creates onunload event handler window.onunload = function () { if ( GUnload ) { GUnload(); } } // global vars var map; var markerbatch = []; var areabatch = []; var bounds = new GLatLngBounds(); var currentbounds = new GLatLngBounds(); var currentzoom = 0; var infowindowisopen = false; var hascookie = false; // Counties var countyLayer = [ { "zoom": [5, 9], "places": [ {"name": "Allegany County - 69 Properties", "posn": [42.332154,-78.015289]}, {"name": "Cattaraugus County - 140 Properties", "posn": [42.317939,-78.706055]}, {"name": "Cayuga County - 175 Properties", "posn": [42.972502,-76.59668]}, {"name": "Chautauqua County - 21 Properties", "posn": [42.354485,-79.299316]}, {"name": "Erie County - 437 Properties", "posn": [42.787339,-78.728027]}, {"name": "Genesee County - 393 Properties", "posn": [42.988576,-78.189697]}, {"name": "Jefferson County - 7 Properties", "posn": [43.842451,-76.036377]}, {"name": "Livingston County - 581 Properties", "posn": [42.815551,-77.816162]}, {"name": "Monroe County - 5290 Properties", "posn": [43.133061,-77.67334]}, {"name": "Niagara County - 184 Properties", "posn": [43.189158,-78.728027]}, {"name": "Onondaga County - 646 Properties", "posn": [42.964463,-76.201172]}, {"name": "Ontario County - 1199 Properties", "posn": [42.886027,-77.291565]}, {"name": "Orleans County - 491 Properties", "posn": [43.249204,-78.241882]}, {"name": "Oswego County - 269 Properties", "posn": [43.373112,-76.223145]}, {"name": "Schuyler County - 152 Properties", "posn": [42.391009,-76.893311]}, {"name": "Seneca County - 362 Properties", "posn": [42.903131,-76.877174]}, {"name": "Steuben County - 792 Properties", "posn": [42.38898,-77.379456]}, {"name": "Wayne County - 960 Properties", "posn": [43.125043,-77.047119]}, {"name": "Wyoming County - 240 Properties", "posn": [42.753063,-78.129272]}, {"name": "Yates County - 356 Properties", "posn": [42.664261,-77.13501]}, ] } ]; // Areas var areaLayer = [ { "zoom": [10, 14], "places": [ {"name": "Addison - 19 Properties", "posn": [42.10374,-77.23398]}, {"name": "Akron - 1 Properties", "posn": [43.02021,-78.50239]}, {"name": "Alabama - 3 Properties", "posn": [43.09639,-78.38971]}, {"name": "Albion - 81 Properties", "posn": [43.24571,-78.19376]}, {"name": "Alden - 11 Properties", "posn": [42.90013,-78.49091]}, {"name": "Alexander - 11 Properties", "posn": [42.90174,-78.25628]}, {"name": "Alfred - 3 Properties", "posn": [42.25615,-77.78964]}, {"name": "Allen - 4 Properties", "posn": [42.38578,-78.01533]}, {"name": "Almond - 1 Properties", "posn": [42.306665,-77.877095]}, {"name": "Amherst - 37 Properties", "posn": [43.01889,-78.78281]}, {"name": "Andover - 43 Properties", "posn": [42.1597,-77.79367]}, {"name": "Angelica - 5 Properties", "posn": [42.30738,-78.0206]}, {"name": "Angola - 3 Properties", "posn": [42.63738,-79.02882]}, {"name": "Arcade - 9 Properties", "posn": [42.53381,-78.42902]}, {"name": "Arcadia - 35 Properties", "posn": [43.11752,-77.07908]}, {"name": "Arkport - 4 Properties", "posn": [42.394551,-77.696595]}, {"name": "Ashford - 8 Properties", "posn": [42.40576,-78.68781]}, {"name": "Attica - 27 Properties", "posn": [42.86408,-78.28098]}, {"name": "Auburn - 53 Properties", "posn": [42.933495,-76.56625]}, {"name": "Aurelius - 14 Properties", "posn": [42.9188489,-76.7105632]}, {"name": "Aurora - 11 Properties", "posn": [42.75771,-76.70293]}, {"name": "Avoca - 19 Properties", "posn": [42.40927,-77.4214]}, {"name": "Avon - 68 Properties", "posn": [42.91251,-77.74692]}, {"name": "Barker - 3 Properties", "posn": [43.33008,-78.5517]}, {"name": "Barre - 10 Properties", "posn": [43.18419,-78.1943]}, {"name": "Barrington - 26 Properties", "posn": [42.54861,-77.05628]}, {"name": "Barton - 5 Properties", "posn": [42.0812564,-76.4794435]}, {"name": "Batavia - 184 Properties", "posn": [42.99841,-78.18836]}, {"name": "Bath - 82 Properties", "posn": [42.3377,-77.31789]}, {"name": "Belfast - 3 Properties", "posn": [42.34334,-78.11142]}, {"name": "Belmont - 1 Properties", "posn": [40.847385,-73.890789]}, {"name": "Bennington - 8 Properties", "posn": [42.83755,-78.39842]}, {"name": "Benton - 14 Properties", "posn": [42.71764,-77.03673]}, {"name": "Bergen - 19 Properties", "posn": [43.08089,-77.94378]}, {"name": "Bethany - 11 Properties", "posn": [42.91314,-78.13319]}, {"name": "Big Flats - 50 Properties", "posn": [42.14362,-76.932467]}, {"name": "Birdsall - 3 Properties", "posn": [42.39183,-77.92066]}, {"name": "Blasdell - 2 Properties", "posn": [42.79793,-78.83029]}, {"name": "Bloomfield - 91 Properties", "posn": [42.89801,-77.43111]}, {"name": "Boston - 11 Properties", "posn": [42.65294,-78.74477]}, {"name": "Bradford - 11 Properties", "posn": [41.95586,-78.65049]}, {"name": "Brighton - 175 Properties", "posn": [43.12618,-77.57498]}, {"name": "Bristol - 65 Properties", "posn": [42.84562,-77.41693]}, {"name": "Brockport - 53 Properties", "posn": [43.21327,-77.93914]}, {"name": "Brutus - 6 Properties", "posn": [43.0498095,-76.5257007]}, {"name": "Buffalo State - 142 Properties", "posn": [42.774308,-78.834174]}, {"name": "Burdett - 2 Properties", "posn": [42.420451,-76.843951]}, {"name": "Butler - 10 Properties", "posn": [43.17165,-76.76996]}, {"name": "Byron - 17 Properties", "posn": [43.07973,-78.06517]}, {"name": "Caledonia - 39 Properties", "posn": [42.97355,-77.85313]}, {"name": "Cambria - 14 Properties", "posn": [43.16376,-78.81731]}, {"name": "Cameron - 18 Properties", "posn": [42.19901,-77.40598]}, {"name": "Camillus - 50 Properties", "posn": [43.038991,-76.3076]}, {"name": "Campbell - 1 Properties", "posn": [42.23142,-77.18354]}, {"name": "Canadice - 30 Properties", "posn": [42.73717,-77.54337]}, {"name": "Canandaigua - 303 Properties", "posn": [42.88809,-77.28093]}, {"name": "Canaseraga - 2 Properties", "posn": [42.461283,-77.777217]}, {"name": "Caneadea - 4 Properties", "posn": [42.38728,-78.15328]}, {"name": "Canisteo - 6 Properties", "posn": [42.26996,-77.60499]}, {"name": "Carlton/Waterport - 37 Properties", "posn": [43.317102,-78.251318]}, {"name": "Castile - 29 Properties", "posn": [42.62945,-78.05405]}, {"name": "Catharine - 2 Properties", "posn": [42.312646,-76.784937]}, {"name": "Catlin - 13 Properties", "posn": [42.2467048,-76.8951551]}, {"name": "Cato - 3 Properties", "posn": [43.168016,-76.572888]}, {"name": "Caton - 8 Properties", "posn": [42.0293394,-77.0334179]}, {"name": "Cattaraugus - 1 Properties", "posn": [42.32892,-78.86827]}, {"name": "Cattaraugus - 1 Properties", "posn": [42.329387,-78.86834]}, {"name": "Cayuga - 43 Properties", "posn": [42.91887,-76.72702]}, {"name": "Cayuta - 2 Properties", "posn": [42.281736,-76.697095]}, {"name": "Chautqua - 1 Properties", "posn": [42.207583,-79.469347]}, {"name": "Cheektowaga - 18 Properties", "posn": [42.90387,-78.74379]}, {"name": "Chemung - 5 Properties", "posn": [42.007124,-76.628495]}, {"name": "Chili - 190 Properties", "posn": [43.10381,-77.7528]}, {"name": "Churchville - 15 Properties", "posn": [43.104359,-77.883319]}, {"name": "Cicero - 53 Properties", "posn": [43.1458619,-76.0623979]}, {"name": "Clarence - 26 Properties", "posn": [43.676766,-79.448384]}, {"name": "Clarendon - 51 Properties", "posn": [43.19358,-78.06471]}, {"name": "Clarkson - 76 Properties", "posn": [43.25188,-77.92183]}, {"name": "Clarksville - 1 Properties", "posn": [42.54439,-73.97914]}, {"name": "Clay - 32 Properties", "posn": [43.1630043,-76.2015572]}, {"name": "Clifton Springs - 20 Properties", "posn": [42.961483,-77.138324]}, {"name": "Clyde - 14 Properties", "posn": [43.083637,-76.869812]}, {"name": "Cohocton - 26 Properties", "posn": [42.50907,-77.51203]}, {"name": "Colden - 3 Properties", "posn": [42.64219,-78.6841]}, {"name": "Collins - 6 Properties", "posn": [42.49576,-78.92013]}, {"name": "Concord - 5 Properties", "posn": [42.5082,-78.63371]}, {"name": "Conesus - 39 Properties", "posn": [42.72029,-77.67589]}, {"name": "Conquest - 1 Properties", "posn": [43.1044489,-76.6643728]}, {"name": "Corfu - 5 Properties", "posn": [42.96425,-78.40587]}, {"name": "Corning - 137 Properties", "posn": [42.14351,-77.0545]}, {"name": "Covert - 28 Properties", "posn": [42.58318,-76.68802]}, {"name": "Covington - 2 Properties", "posn": [42.84649,-78.01]}, {"name": "Cuba - 4 Properties", "posn": [42.2195,-78.2769]}, {"name": "Dansville - 62 Properties", "posn": [42.56164,-77.69658]}, {"name": "Darien - 8 Properties", "posn": [40.604373,-74.083722]}, {"name": "Delaware Park - 71 Properties", "posn": [43.29062,-75.419868]}, {"name": "Delevan - 1 Properties", "posn": [42.48996,-78.48028]}, {"name": "Depew - 4 Properties", "posn": [42.9044,-78.6864]}, {"name": "DeWitt - 44 Properties", "posn": [43.036535,-76.074273]}, {"name": "Dix - 13 Properties", "posn": [42.3242404,-76.8951551]}, {"name": "Dresden - 4 Properties", "posn": [41.170983,-73.228649]}, {"name": "Dundee - 12 Properties", "posn": [42.498049,-77.114407]}, {"name": "Dunkirk - 1 Properties", "posn": [42.48708,-79.33634]}, {"name": "Eagle - 2 Properties", "posn": [42.54543,-78.304]}, {"name": "East Rochester - 44 Properties", "posn": [43.11064,-77.49693]}, {"name": "Eden - 6 Properties", "posn": [42.65242,-78.8948]}, {"name": "Elba - 8 Properties", "posn": [43.08195,-78.18633]}, {"name": "Elbridge - 19 Properties", "posn": [43.035358,-76.442955]}, {"name": "Ellery - 1 Properties", "posn": [42.182908,-79.367392]}, {"name": "Ellicottville - 81 Properties", "posn": [42.27549,-78.67179]}, {"name": "Elma - 6 Properties", "posn": [42.84885,-78.64054]}, {"name": "Elmira - 247 Properties", "posn": [42.095597,-76.812471]}, {"name": "Erie - 3 Properties", "posn": [42.76823,-78.882795]}, {"name": "Erin - 7 Properties", "posn": [42.1809168,-76.6643728]}, {"name": "Erwin - 37 Properties", "posn": [42.156626,-77.1255055]}, {"name": "Evans - 10 Properties", "posn": [42.6465,-79.04304]}, {"name": "Fairport - 25 Properties", "posn": [43.123431,-77.436926]}, {"name": "Farmersville - 3 Properties", "posn": [42.38803,-78.37577]}, {"name": "Farmington - 77 Properties", "posn": [42.98298,-77.32571]}, {"name": "Fayette - 30 Properties", "posn": [42.81777,-76.80338]}, {"name": "Fillmore - 2 Properties", "posn": [42.46587,-78.11292]}, {"name": "Fleming - 7 Properties", "posn": [42.8641384,-76.5719414]}, {"name": "Franklinville - 3 Properties", "posn": [42.33741,-78.45779]}, {"name": "Fremont - 35 Properties", "posn": [41.8428,-75.04208]}, {"name": "Friendship - 1 Properties", "posn": [42.20777,-78.13422]}, {"name": "Fulton - 26 Properties", "posn": [43.316114,-76.418353]}, {"name": "Gaines - 22 Properties", "posn": [43.28402,-78.21888]}, {"name": "Gainesville - 5 Properties", "posn": [42.641362,-78.134143]}, {"name": "Galen - 11 Properties", "posn": [43.10713,-76.87036]}, {"name": "Gates - 173 Properties", "posn": [43.14976,-77.69706]}, {"name": "Geddes - 6 Properties", "posn": [43.0596838,-76.2131474]}, {"name": "Genesee Falls - 6 Properties", "posn": [42.59325,-78.06161]}, {"name": "Geneseo - 58 Properties", "posn": [42.79339,-77.8162]}, {"name": "Geneva - 168 Properties", "posn": [42.86641,-76.9821]}, {"name": "Genoa - 1 Properties", "posn": [42.6612481,-76.5603828]}, {"name": "Gerry - 1 Properties", "posn": [42.1948,-79.24748]}, {"name": "Gorham - 37 Properties", "posn": [42.79941,-77.13155]}, {"name": "Gowanda - 1 Properties", "posn": [42.46383,-78.93415]}, {"name": "Granby - 8 Properties", "posn": [43.267184,-76.4331698]}, {"name": "Grand Island - 19 Properties", "posn": [43.02274,-78.96575]}, {"name": "Granger - 2 Properties", "posn": [42.44671,-78.01439]}, {"name": "Great Valley - 11 Properties", "posn": [42.21494,-78.63693]}, {"name": "Greece - 634 Properties", "posn": [43.20962,-77.69476]}, {"name": "Greenwood - 1 Properties", "posn": [42.1400659,-77.6765184]}, {"name": "Groveland - 18 Properties", "posn": [42.66446,-77.76947]}, {"name": "Hamburg - 15 Properties", "posn": [42.71604,-78.83192]}, {"name": "Hamlin - 76 Properties", "posn": [43.29548,-77.93208]}, {"name": "Hammondsport - 33 Properties", "posn": [42.490987,-77.122582]}, {"name": "Hannibal - 6 Properties", "posn": [43.321092,-76.578396]}, {"name": "Hartland - 3 Properties", "posn": [43.24244,-78.533]}, {"name": "Hastings - 11 Properties", "posn": [43.3092732,-76.1551866]}, {"name": "Hector - 8 Properties", "posn": [42.500809,-76.872644]}, {"name": "Henrietta - 175 Properties", "posn": [43.06829,-77.62587]}, {"name": "Hilton - 28 Properties", "posn": [43.287083,-77.78714]}, {"name": "Holland - 3 Properties", "posn": [42.64271,-78.54318]}, {"name": "Holley - 19 Properties", "posn": [43.22283,-78.02423]}, {"name": "Honeoye Falls - 33 Properties", "posn": [42.95252,-77.59071]}, {"name": "Hopewell - 28 Properties", "posn": [42.90101,-77.17994]}, {"name": "Hornby - 10 Properties", "posn": [42.2238248,-77.0334179]}, {"name": "Hornell - 27 Properties", "posn": [42.325702,-77.661315]}, {"name": "Hornellsville - 8 Properties", "posn": [42.33482,-77.68295]}, {"name": "Horseheads - 111 Properties", "posn": [42.168021,-76.832211]}, {"name": "Howard - 10 Properties", "posn": [42.36375,-77.51256]}, {"name": "Hume - 2 Properties", "posn": [42.47234,-78.13701]}, {"name": "Humphrey - 3 Properties", "posn": [42.23379,-78.52572]}, {"name": "Huron - 30 Properties", "posn": [43.24516,-76.91706]}, {"name": "Interlaken - 3 Properties", "posn": [42.619217,-76.724903]}, {"name": "Ira - 7 Properties", "posn": [43.2022435,-76.5257007]}, {"name": "Irondequoit - 382 Properties", "posn": [43.2112,-77.58192]}, {"name": "Ischua - 1 Properties", "posn": [42.24714,-78.3987]}, {"name": "Italy - 22 Properties", "posn": [42.62669,-77.28132]}, {"name": "Jamestown - 1 Properties", "posn": [42.09604,-79.23781]}, {"name": "Jasper - 8 Properties", "posn": [42.12352,-77.50249]}, {"name": "Java - 3 Properties", "posn": [42.65008,-78.38691]}, {"name": "Jerusalem - 86 Properties", "posn": [42.59868,-77.15606]}, {"name": "Junius - 13 Properties", "posn": [42.98996,-76.90567]}, {"name": "Kendall/Morton - 26 Properties", "posn": [43.32806,-77.99556]}, {"name": "Kenmore - 3 Properties", "posn": [42.96239,-78.87879]}, {"name": "Lackawana - 9 Properties", "posn": [42.818112,-78.827968]}, {"name": "Lafayette - 12 Properties", "posn": [42.892115,-76.105414]}, {"name": "Lakewood - 1 Properties", "posn": [42.10338,-79.3271]}, {"name": "Lancaster - 18 Properties", "posn": [42.90028,-78.66964]}, {"name": "Ledyard - 4 Properties", "posn": [42.695122,-76.621617]}, {"name": "Leicester - 12 Properties", "posn": [42.77201,-77.89397]}, {"name": "LeRoy - 55 Properties", "posn": [41.644148,-76.708829]}, {"name": "Lewiston - 13 Properties", "posn": [43.17404,-79.04443]}, {"name": "Lima - 33 Properties", "posn": [42.90508,-77.61096]}, {"name": "Lincoln - 9 Properties", "posn": [43.06041,-75.7498]}, {"name": "Lindley - 10 Properties", "posn": [42.0398457,-77.1255055]}, {"name": "Little Valley - 2 Properties", "posn": [42.24936,-78.79931]}, {"name": "Livonia - 99 Properties", "posn": [42.82179,-77.66827]}, {"name": "Locke - 5 Properties", "posn": [42.6556381,-76.4331698]}, {"name": "Lockport - 35 Properties", "posn": [43.16918,-78.69552]}, {"name": "Lodi - 16 Properties", "posn": [42.61403,-76.822]}, {"name": "Lyndonville - 12 Properties", "posn": [43.32193,-78.38876]}, {"name": "Lyons - 73 Properties", "posn": [43.06044,-76.99216]}, {"name": "Lysander - 36 Properties", "posn": [43.1855567,-76.3868797]}, {"name": "Macedon - 90 Properties", "posn": [43.06941,-77.29833]}, {"name": "Machias - 2 Properties", "posn": [42.41784,-78.49386]}, {"name": "Manchester - 28 Properties", "posn": [42.97013,-77.23008]}, {"name": "Mansfeld - 8 Properties", "posn": [40.615564,-75.26063]}, {"name": "Marcellus - 21 Properties", "posn": [42.982442,-76.340043]}, {"name": "Marilla - 4 Properties", "posn": [42.8345,-78.55509]}, {"name": "Marion - 46 Properties", "posn": [43.14307,-77.18908]}, {"name": "Mayville - 7 Properties", "posn": [42.2537,-79.50436]}, {"name": "Medina - 110 Properties", "posn": [43.21973,-78.38691]}, {"name": "Mendon - 90 Properties", "posn": [42.99762,-77.50757]}, {"name": "Mentz - 1 Properties", "posn": [43.0335594,-76.6297189]}, {"name": "Mexico - 11 Properties", "posn": [43.465749,-76.232337]}, {"name": "Middlebury - 7 Properties", "posn": [42.85556,-78.08956]}, {"name": "Middleport - 5 Properties", "posn": [43.21174,-78.47647]}, {"name": "Middlesex - 33 Properties", "posn": [42.70436,-77.2719]}, {"name": "Millport - 1 Properties", "posn": [42.268757,-76.835953]}, {"name": "Milo - 36 Properties", "posn": [42.63032,-77.03963]}, {"name": "Minetto - 4 Properties", "posn": [43.4015061,-76.4852265]}, {"name": "Montezuma - 6 Properties", "posn": [43.0035503,-76.6990172]}, {"name": "Montour Falls - 16 Properties", "posn": [42.348376,-76.845401]}, {"name": "Moravia - 4 Properties", "posn": [42.713391,-76.421654]}, {"name": "Mt. Morris - 60 Properties", "posn": [42.72555,-77.874]}, {"name": "Mumford - 7 Properties", "posn": [42.99271,-77.86007]}, {"name": "Murray - 21 Properties", "posn": [43.27312,-78.04365]}, {"name": "Naples - 38 Properties", "posn": [42.61523,-77.40252]}, {"name": "New Haven - 6 Properties", "posn": [43.479571,-76.31471]}, {"name": "Newark - 98 Properties", "posn": [43.04618,-77.09518]}, {"name": "Newfane - 8 Properties", "posn": [43.27583,-78.69882]}, {"name": "Newstead - 7 Properties", "posn": [43.00684,-78.51689]}, {"name": "Niagara - 93 Properties", "posn": [43.12164,-78.98522]}, {"name": "Niles - 3 Properties", "posn": [42.8092087,-76.4331698]}, {"name": "North Collins - 7 Properties", "posn": [42.59467,-78.94096]}, {"name": "Nunda - 31 Properties", "posn": [42.58043,-77.94244]}, {"name": "Oakfield - 14 Properties", "posn": [43.06599,-78.27071]}, {"name": "Odessa - 3 Properties", "posn": [42.336233,-76.786701]}, {"name": "Ogden - 151 Properties", "posn": [43.17226,-77.79902]}, {"name": "Olean - 3 Properties", "posn": [42.07752,-78.42891]}, {"name": "Onondaga - 3 Properties", "posn": [43.00489,-76.18358]}, {"name": "Ontario - 145 Properties", "posn": [43.22128,-77.28494]}, {"name": "Orange - 9 Properties", "posn": [42.76098,-78.24854]}, {"name": "Orangeville - 10 Properties", "posn": [42.739017,-78.249059]}, {"name": "Orchard Park - 12 Properties", "posn": [42.76616,-78.74388]}, {"name": "Ossian - 6 Properties", "posn": [42.52396,-77.78271]}, {"name": "Oswego - 1 Properties", "posn": [43.451877,-76.504435]}, {"name": "Oswegot - 7 Properties", "posn": [43.451877,-76.504435]}, {"name": "Otisco - 5 Properties", "posn": [42.8577077,-76.2015572]}, {"name": "Otto - 2 Properties", "posn": [42.3559,-78.83136]}, {"name": "Ovid - 28 Properties", "posn": [42.67963,-76.82117]}, {"name": "Owasco - 25 Properties", "posn": [42.8913815,-76.4794435]}, {"name": "Painted Post - 13 Properties", "posn": [42.160016,-77.090249]}, {"name": "Palermo - 2 Properties", "posn": [43.3585596,-76.247912]}, {"name": "Palmyra - 58 Properties", "posn": [43.06337,-77.23341]}, {"name": "Parish - 2 Properties", "posn": [43.40729,-76.127425]}, {"name": "Parma - 128 Properties", "posn": [43.25205,-77.79107]}, {"name": "Pavilion - 13 Properties", "posn": [42.87573,-78.02285]}, {"name": "Pembroke - 23 Properties", "posn": [42.99836,-78.43496]}, {"name": "Pendleton - 11 Properties", "posn": [43.10862,-78.77311]}, {"name": "Penfield - 277 Properties", "posn": [43.13103,-77.45359]}, {"name": "Penn Yan - 63 Properties", "posn": [42.665623,-77.04167]}, {"name": "Perinton - 250 Properties", "posn": [43.08627,-77.43205]}, {"name": "Perry - 55 Properties", "posn": [42.71962,-78.0055]}, {"name": "Phelps - 65 Properties", "posn": [42.9581,-77.0593]}, {"name": "Pike - 3 Properties", "posn": [42.55728,-78.15115]}, {"name": "Pittsford - 258 Properties", "posn": [43.09117,-77.51613]}, {"name": "Port Byron - 9 Properties", "posn": [43.035676,-76.631382]}, {"name": "Portage - 3 Properties", "posn": [42.54681,-77.99725]}, {"name": "Porter - 4 Properties", "posn": [43.25735,-79.00923]}, {"name": "Portville - 1 Properties", "posn": [42.036029,-78.338481]}, {"name": "Potter - 5 Properties", "posn": [42.70448,-77.20628]}, {"name": "Prattsburg - 50 Properties", "posn": [42.52342,-77.28905]}, {"name": "Preble - 2 Properties", "posn": [42.735342,-76.148212]}, {"name": "Pulteney - 44 Properties", "posn": [42.52487,-77.16737]}, {"name": "Randolph - 1 Properties", "posn": [42.16195,-78.97608]}, {"name": "Rathbone - 6 Properties", "posn": [42.16033,-77.32073]}, {"name": "Reading - 15 Properties", "posn": [42.421652,-76.931392]}, {"name": "Red Creek - 5 Properties", "posn": [43.255711,-76.783892]}, {"name": "Richmond/Honeoye - 57 Properties", "posn": [42.790116,-77.517095]}, {"name": "Ridgeway - 36 Properties", "posn": [43.26811,-78.40285]}, {"name": "Riga - 18 Properties", "posn": [43.09361,-77.88461]}, {"name": "Riverside - 1 Properties", "posn": [42.154729,-77.079732]}, {"name": "Rochester NE - 546 Properties", "posn": [43.171383,-77.588196]}, {"name": "Rochester NW - 476 Properties", "posn": [43.178644,-77.638321]}, {"name": "Rochester SE - 244 Properties", "posn": [43.149094,-77.586479]}, {"name": "Rochester SW - 268 Properties", "posn": [43.149344,-77.627335]}, {"name": "Romulus - 45 Properties", "posn": [42.75206,-76.81817]}, {"name": "Rose - 11 Properties", "posn": [43.15283,-76.87816]}, {"name": "Royalton - 9 Properties", "posn": [43.16301,-78.53828]}, {"name": "Rush - 39 Properties", "posn": [42.99408,-77.64559]}, {"name": "Rushford - 4 Properties", "posn": [42.39314,-78.25354]}, {"name": "Rushville - 4 Properties", "posn": [42.758044,-77.22812]}, {"name": "Salamanca - 9 Properties", "posn": [42.156654,-78.726134]}, {"name": "Salina - 14 Properties", "posn": [43.0949558,-76.1899661]}, {"name": "Sardinia - 1 Properties", "posn": [42.52808,-78.516815]}, {"name": "Savannah - 8 Properties", "posn": [43.06727,-76.75906]}, {"name": "Savona - 2 Properties", "posn": [42.282568,-77.220341]}, {"name": "Scipio - 2 Properties", "posn": [42.7874635,-76.5719414]}, {"name": "Scottsville - 31 Properties", "posn": [43.01975,-77.74994]}, {"name": "Scriba - 17 Properties", "posn": [43.465392,-76.43061]}, {"name": "Seneca - 133 Properties", "posn": [42.80344,-77.05527]}, {"name": "Seneca Falls - 11 Properties", "posn": [42.91024,-76.795736]}, {"name": "Shelby - 22 Properties", "posn": [43.19281,-78.39431]}, {"name": "Sheldon - 1 Properties", "posn": [42.73742,-78.40082]}, {"name": "Sheridan - 1 Properties", "posn": [42.4864,-79.2368]}, {"name": "Shortsville - 10 Properties", "posn": [42.975408,-77.222318]}, {"name": "Silver Creek - 1 Properties", "posn": [42.54406,-79.16579]}, {"name": "Silver Springs - 7 Properties", "posn": [42.636553,-78.048859]}, {"name": "Skaneateles - 38 Properties", "posn": [42.94565,-76.427827]}, {"name": "Sloan - 1 Properties", "posn": [42.89189,-78.79201]}, {"name": "Sodus - 52 Properties", "posn": [43.263385,-76.993944]}, {"name": "Sodus Point - 30 Properties", "posn": [43.27051,-76.98417]}, {"name": "Somerset - 1 Properties", "posn": [43.34738,-78.55731]}, {"name": "Southport - 70 Properties", "posn": [42.0523715,-76.8951551]}, {"name": "Spafford - 1 Properties", "posn": [42.838894,-76.2826675]}, {"name": "Sparta - 18 Properties", "posn": [42.60727,-77.69952]}, {"name": "Spencerport - 40 Properties", "posn": [43.189492,-77.808255]}, {"name": "Springport - 6 Properties", "posn": [42.8477265,-76.675922]}, {"name": "Springville - 9 Properties", "posn": [42.50863,-78.66675]}, {"name": "Springwater - 24 Properties", "posn": [42.6354,-77.59666]}, {"name": "Stafford - 22 Properties", "posn": [42.98258,-78.08126]}, {"name": "Starkey - 37 Properties", "posn": [42.53576,-76.92401]}, {"name": "Sterling - 1 Properties", "posn": [43.2947837,-76.6643728]}, {"name": "Summerhill - 1 Properties", "posn": [42.6444639,-76.3405733]}, {"name": "Swain/Grove - 5 Properties", "posn": [42.503077,-77.903766]}, {"name": "Sweden - 56 Properties", "posn": [43.20522,-77.94164]}, {"name": "Syracuse - 177 Properties", "posn": [43.050831,-76.147375]}, {"name": "Throop - 10 Properties", "posn": [42.9844315,-76.6181655]}, {"name": "Thurston - 27 Properties", "posn": [42.22289,-77.26232]}, {"name": "Tompkins - 3 Properties", "posn": [42.08372,-75.3174]}, {"name": "Tonawanda - 22 Properties", "posn": [43.009094,-78.880247]}, {"name": "Torrey - 8 Properties", "posn": [42.68082,-76.9666]}, {"name": "Troupsburg - 4 Properties", "posn": [42.043365,-77.545944]}, {"name": "Tully - 20 Properties", "posn": [42.798129,-76.109517]}, {"name": "Tuscarora - 2 Properties", "posn": [42.0554457,-77.2635038]}, {"name": "Tyre - 6 Properties", "posn": [42.99322,-76.80559]}, {"name": "Tyrone - 37 Properties", "posn": [42.40824,-77.058208]}, {"name": "Ulysses - 3 Properties", "posn": [42.5236928,-76.6181655]}, {"name": "Urbana - 33 Properties", "posn": [42.40074,-77.22236]}, {"name": "Van Buren - 15 Properties", "posn": [43.1147241,-76.3521514]}, {"name": "Van Etten - 2 Properties", "posn": [42.197358,-76.551864]}, {"name": "Varick - 25 Properties", "posn": [42.80589,-76.8453]}, {"name": "Venice - 1 Properties", "posn": [42.7106747,-76.5719414]}, {"name": "Veteran - 14 Properties", "posn": [42.2359765,-76.8028933]}, {"name": "Victor - 148 Properties", "posn": [42.98223,-77.40842]}, {"name": "Volney - 17 Properties", "posn": [43.3754481,-76.3868797]}, {"name": "Wales - 5 Properties", "posn": [42.76816,-78.52954]}, {"name": "Walworth - 89 Properties", "posn": [43.13853,-77.27245]}, {"name": "Ward - 1 Properties", "posn": [42.24739,-77.8427]}, {"name": "Warsaw - 51 Properties", "posn": [42.74022,-78.13364]}, {"name": "Waterloo - 69 Properties", "posn": [42.89895,-76.86311]}, {"name": "Watkins Glen - 14 Properties", "posn": [42.382336,-76.867449]}, {"name": "Waverly - 7 Properties", "posn": [42.006037,-76.537354]}, {"name": "Wayland - 47 Properties", "posn": [42.56776,-77.58991]}, {"name": "Wayne - 53 Properties", "posn": [42.47412,-77.09817]}, {"name": "Webster - 308 Properties", "posn": [43.2173,-77.43021]}, {"name": "Wellsburg - 3 Properties", "posn": [42.016537,-76.728648]}, {"name": "Wellsville - 3 Properties", "posn": [42.12783,-77.95914]}, {"name": "Wethersfield - 3 Properties", "posn": [42.65251,-78.24615]}, {"name": "Wheatfield - 10 Properties", "posn": [43.08594,-78.89152]}, {"name": "Wheatland - 23 Properties", "posn": [43.0027,-77.84454]}, {"name": "Wheeler - 10 Properties", "posn": [42.43026,-77.33232]}, {"name": "Williamson - 94 Properties", "posn": [43.22532,-77.18601]}, {"name": "Wilson - 11 Properties", "posn": [43.30717,-78.82607]}, {"name": "Wirt - 1 Properties", "posn": [42.13609,-78.15111]}, {"name": "Wolcott - 60 Properties", "posn": [43.22039,-76.81424]}, {"name": "Woodhull - 3 Properties", "posn": [42.0708548,-77.4013403]}, {"name": "Wyoming - 7 Properties", "posn": [42.672622,-78.435995]}, {"name": "Yates - 44 Properties", "posn": [43.30969,-78.38885]}, {"name": "York - 17 Properties", "posn": [42.87675,-77.88255]}, {"name": "Yorkshire - 1 Properties", "posn": [42.53023,-78.4784]}, {"name": "Youngstown - 1 Properties", "posn": [43.250319,-79.046366]}, ] } ] ; // instanciates the map function load() { if(GBrowserIsCompatible()) { // Common map configuration map = new GMap2(document.getElementById("map")); setTimeout('GSliderControl.imgPreLoader(initGSlider)',500); map.addMapType(G_PHYSICAL_MAP); map.addControl(new GHierarchicalMapTypeControl()); map.addControl(new GScaleControl()); map.addControl(new GOverviewMapControl(new GSize(200,180))); // Adds the areas to the map window.setTimeout(setupCountyMarkers, 0); // Adds the areas to the map window.setTimeout(setupAreaMarkers, 0); // Adds the offices to the map window.setTimeout(loadOffices, 0); // Reload markers after map is moved GEvent.addListener(map, "moveend", function() { reloadmarkers(); }); GEvent.addListener(map, "infowindowopen", function() { infowindowisopen = true; }); GEvent.addListener(map, "infowindowclose", function() { infowindowisopen = false; reloadmarkers(); }); // This seems to be necessary to trigger the reload event. //GEvent.addListener(map, "zoomend", function() { if(hascookie) { setTimeout('map.panTo(new GLatLng(map.getCenter().lat()+0.0001, map.getCenter().lng()+0.0001));',1200); } }); GEvent.addListener(map, "zoomend", function() { setTimeout('map.panTo(new GLatLng(map.getCenter().lat()+0.0001, map.getCenter().lng()+0.0001));',1200); } ); // recenters and zooms on markers centerAndZoomOnBounds(bounds); map.setCenter(new GLatLng(42.955490,-77.616010), 8); } else document.getElementById("map").innerHTML = "
Your browser does not support interactive maps
"; } function reloadmarkers() { var center = map.getCenter(); if(map.getZoom() > 14 && infowindowisopen == false) { var bounds = map.getBounds(); if(!(bounds.equals(currentbounds))) { currentbounds = bounds; currentzoom = map.getZoom(); GDownloadUrl('getProps.asp?lat=' + center.lat() + '&lng=' + center.lng() + '&z=' + map.getZoom() + '&s=' + bounds.getSouthWest().lat() + '&w=' + bounds.getSouthWest().lng() + '&n=' + bounds.getNorthEast().lat() + '&e=' + bounds.getNorthEast().lng(), function(data, responseCode) { var xml = GXml.parse(data); var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var baths = (markers[i].getAttribute("bathshalf") == 0) ? markers[i].getAttribute("bathsfull") : markers[i].getAttribute("bathsfull") + ' Full, ' + markers[i].getAttribute("bathshalf") + ' half'; AddProperty(markers[i].getAttribute("mlnum"), markers[i].getAttribute("mlsid"), markers[i].getAttribute("mn"), markers[i].getAttribute("idx"), parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng")), markers[i].getAttribute("address"), markers[i].getAttribute("city"), markers[i].getAttribute("zipcode"), markers[i].getAttribute("photopath"), markers[i].getAttribute("listprice"), markers[i].getAttribute("bedrooms"), baths, markers[i].getAttribute("proptype"), markers[i].getAttribute("acres"), markers[i].getAttribute("pid"), markers[i].getAttribute("agent"), markers[i].getAttribute("phone"), markers[i].getAttribute("agentphoto"), markers[i].getAttribute("oh")); } }); map.clearOverlays(); window.setTimeout(refreshOffices, 0); mgr = new GMarkerManager(map); mgr.addMarkers(markerbatch, 15, 17); mgr.refresh(); while(markerbatch.length > 0) { markerbatch.pop(); } } } else if(currentzoom == 15 && map.getZoom() == 14) { currentzoom = 14; map.clearOverlays(); window.setTimeout(refreshOffices, 0); setupAreaMarkers(); } } function setupCountyMarkers() { mgr = new GMarkerManager(map); for (var i in countyLayer) { var layer = countyLayer[i]; var markers = []; for (var j in layer["places"]) { var place = layer["places"][j]; var icon = icon_County; var posn = new GLatLng(place["posn"][0], place["posn"][1]); markers.push(createMarker_County(icon, posn, place["name"])); } mgr.addMarkers(markers, layer["zoom"][0], layer["zoom"][1]); } mgr.refresh(); } function setupAreaMarkers() { mgr = new GMarkerManager(map); for (var i in areaLayer) { var layer = areaLayer[i]; var markers = []; for (var j in layer["places"]) { var place = layer["places"][j]; var icon = icon_Area; var posn = new GLatLng(place["posn"][0], place["posn"][1]); markers.push(createMarker_Area(icon, posn, place["name"])); } mgr.addMarkers(markers, layer["zoom"][0], layer["zoom"][1]); } mgr.refresh(); } function createMarker_County(myicon, point, mytitle) { var options = { title: mytitle, icon: myicon }; var marker = new GMarker(point, options); GEvent.addListener(marker, "click", function() { map.setCenter(point, 10); }); return marker; } function createMarker_Area(myicon, point, mytitle) { var options = { title: mytitle, icon: myicon }; var marker = new GMarker(point, options); GEvent.addListener(marker, "click", function() { map.setCenter(point, 15); }); return marker; } function centerAndZoomOnBounds(bounds) { var SW = bounds.getSouthWest(); var NE = bounds.getNorthEast(); var newSW = new GLatLng(SW.lat() - 0.005, SW.lng() - 0.005); var newNE = new GLatLng(NE.lat() + 0.005, NE.lng() + 0.005); bounds.extend(newSW); bounds.extend(newNE); var center = bounds.getCenter(); var newZoom = map.getBoundsZoomLevel(bounds); if(newZoom > 15) { newZoom = 15; } if (map.getZoom() != newZoom) { map.setCenter(center, newZoom); } else { map.panTo(center); } }