Hi all,

I have a large KML file that draws polygons of every county in the United 
States. I wrote a parser that converted the KML data I need into database 
fields. So when I'm looking at Florida on the map, for example, I pull only 
the coordinates for Florida counties and plot them as polygons. 

I basically make the database request, loop through each individual county 
returned, split the returned coordinates string by spaces and then by 
commas, and plot the polygons county by county. It works well when the 
county coordinates make up a single closed polygon. The problem I'm running 
into is when a county is made up of several polygons, like Miami-Dade County 
in Florida, for example. Google Maps will only plot one of them and omit the 
rest.

It's my understanding that to plot several polygons in Google Maps, each 
polygon needs its own array. In my case, my raw data is in one long string 
(and eventually converted to one array of lat/lng coordinates), as shown 
below, so I don't really know where one polygon ends and the next begins. Is 
there some way to make Google Maps plot all the points?

Thanks :).

Sample raw data (Miami-Dade County, FL):

-80.872945,25.979434 -80.777700999999993,25.978992000000002 
-80.777356999999995,25.978984 -80.776477999999997,25.978966 
-80.680037999999996,25.978748 -80.680098,25.956900999999998 
-80.465345999999997,25.956771 -80.455724000000004,25.95675 
-80.439576000000002,25.956869999999999 -80.438676,25.956869999999999 
-80.430475999999999,25.956969999999998 -80.375073,25.957072 
-80.351703999999998,25.957142 -80.351172000000005,25.957142999999999 
-80.341273,25.95717 -80.340125,25.957121 
-80.338308999999995,25.957080999999999 -80.326779000000002,25.957118 
-80.312836000000004,25.957165 -80.310942999999995,25.95717 
-80.310287000000002,25.957159 -80.310108,25.957155 
-80.309706000000006,25.957145 -80.294972,25.956769999999999 
-80.295072000000005,25.963566 -80.295186999999999,25.970569999999999 
-80.279165000000006,25.970959 -80.262771,25.971268999999999 
-80.246971000000002,25.971869000000002 -80.23017,25.972169 
-80.229770000000002,25.972269 -80.226965000000007,25.972327 
-80.224969999999999,25.972369 -80.223966000000004,25.972382 
-80.223164999999995,25.972398999999999 
-80.214474999999993,25.972563999999998 -80.214269999999999,25.972569 
-80.206269000000006,25.972769 -80.204069000000004,25.972868999999999 
-80.198268999999996,25.972968999999999 -80.195093,25.97314 
-80.191368999999995,25.973168999999999 
-80.182768999999993,25.973369000000002 -80.181467999999995,25.973469 
-80.174464999999998,25.973569 -80.174368,25.973569 
-80.173968000000002,25.973569 -80.166567999999998,25.973669 
-80.166268000000002,25.973769 -80.158467999999999,25.974069 
-80.154368000000005,25.974169 -80.147966999999994,25.974468999999999 
-80.146266999999995,25.974468999999999 
-80.142466999999996,25.974668999999999 
-80.133866999999995,25.974869000000002 -80.133866999999995,25.974169 
-80.124178,25.974367999999998 -80.123867000000004,25.974969000000002 
-80.123266999999998,25.974969000000002 
-80.122731000000002,25.974969000000002 -80.122467,25.974969000000002 
-80.119765999999998,25.975069 -80.118266000000006,25.974969000000002 
-80.117798443708068,25.974947747441277 
-80.117830737140849,25.956906428785139 
-80.117831339338537,25.956569999999999 
-80.117866799981428,25.936759261301013 -80.11787971800635,25.929542369696978 
-80.117895423680878,25.920768106496212 
-80.117904367317024,25.915771580092088 
-80.119221359348103,25.901284677958863 
-80.119367538298434,25.899676710638243 -80.119699242914862,25.89602796242886 
-80.120548131544808,25.886690194079559 
-80.120847122493629,25.883401295960148 -80.12086978678019,25.883151988983645 
-80.120766125373322,25.879472 -80.120664864621162,25.87587723446844 
-80.120628712866122,25.874593844011649 -80.120560520244581,25.872173 
-80.120098549548402,25.855772999999999 
-80.119949453656005,25.850480082818084 
-80.119795851973734,25.845027209702739 
-80.119683623592195,25.841043092371201 
-80.120048308705421,25.837487400149737 
-80.121961406976141,25.818834627131743 
-80.122055949968185,25.817912829753077 
-80.123064591644322,25.812869638746648 -80.12410608045333,25.807662212641667 
-80.125932890092884,25.798528195911466 
-80.126132496840128,25.797530165613537 -80.12690333261844,25.793676 
-80.12739371879367,25.791224077570952 -80.127545799812694,25.786357375915806 
-80.127727694792583,25.780536606136074 
-80.127986788894503,25.772245409097149 
-80.128470415649431,25.771127021420991 
-80.129787960341488,25.768080197126448 
-80.131395926846764,25.764361771905147 
-80.132521064984502,25.761759888087859 -80.1348868324243,25.756289046943504 
-80.136903361699737,25.751625819635819 
-80.137476117384836,25.750301321160187 
-80.137680476003325,25.750004072244206 
-80.140128099898675,25.746443891836776 
-80.144000026411987,25.740811998416447 
-80.144889761170163,25.737015800000044 
-80.147403952744042,25.726288591712866 
-80.151504794715635,25.708791680801557 
-80.152896284801471,25.702854661468841 -80.153020785955675,25.70080038669424 
-80.154082447989467,25.683282914274329 -80.1540703887852,25.683238697321862 
-80.15230319171431,25.676758993754007 -80.154972087620209,25.665490411861814 
-80.158190927336818,25.665168529137691 -80.15867800959137,25.665119821101015 
-80.160902926546527,25.664897330267816 
-80.173584795937714,25.680867102848222 
-80.176916164064011,25.685062161929618 
-80.176615570011592,25.686237212514492 
-80.176363044060125,25.687224360345883 
-80.172486182391864,25.702379379329667 
-80.171161211756754,25.707558814874801 
-80.170392255036845,25.710564739430581 
-80.170345640580905,25.710653306824593 
-80.164461416110527,25.721833324196062 
-80.166240672385683,25.728950326310386 
-80.172698632039911,25.737756630792692 
-80.172764581412849,25.737846561713546 
-80.182003686722638,25.743851983745735 -80.18379296689568,25.745015016551694 
-80.184626259265485,25.745556656915028 
-80.197674077319817,25.744370493727025 
-80.198518625088269,25.744051796152945 
-80.214222043611571,25.738125972208874 
-80.214687892362591,25.737950180060238 
-80.224066289591207,25.734411158873748 
-80.227215700714822,25.733222700716158 
-80.229107493747094,25.732508815874382 
-80.232531074474011,25.729986178179139 
-80.237081852694573,25.726632974151677 
-80.237452710548595,25.726359710549396 -80.24029752845783,25.724263529542913 
-80.240376078512583,25.724205650572063 
-80.240575586509351,25.723863637810137 
-80.244527661163744,25.717088671444063 
-80.246068619140985,25.709537982730652 -80.246131142135013,25.70923162027799 
-80.246849780267951,25.705710295933322 
-80.247144222005019,25.704267532448778 
-80.250079650619284,25.689883942478087 
-80.250458500090062,25.688027581392777 
-80.265878656013541,25.658373409747494 
-80.266114048819546,25.657078744752848 
-80.266781401886377,25.653408289952839 
-80.267064819201536,25.651849489227175 -80.27714724077903,25.637022414897693 
-80.282911945921839,25.633684952478273 -80.288330132802102,25.63054810598808 
-80.288415825544504,25.63049849437737 -80.288716676870209,25.630197643468097 
-80.289122473285786,25.629791847614218 
-80.296719002339984,25.622195329075048 
-80.301209754550698,25.613775156442099 -80.30146366658515,25.613299070685567 
-80.302066012070824,25.610373393207826 
-80.304303570046429,25.599505256681443 
-80.305615249236311,25.593134244770344 -80.305615249236311,25.578287577931 
-80.305615249236311,25.575341739484543 
-80.302759738261983,25.569154805188582 -80.302056748179155,25.5676316615228 
-80.305443403104135,25.559503687077662 
-80.313338168137477,25.540556244878037 -80.31391841453862,25.539163653065522 
-80.315414911224082,25.538664822448151 
-80.324593917710104,25.535605163501522 
-80.325503197336928,25.534955677334583 
-80.327257140842221,25.533702859157778 
-80.328745500361265,25.532639744038359 -80.328946931530922,25.53201306846908 
-80.330461536729445,25.527300957246936 
-80.338654292484406,25.501812350466057 
-80.339420992039592,25.499427059842755 
-80.339420992039592,25.496703638751931 
-80.339420992039592,25.493518886624045 
-80.339420992039592,25.492695153565748 
-80.339420992039592,25.478669146586952 
-80.337472758926211,25.467953826709117 
-80.337048665663588,25.465621305546311 
-80.336206456732967,25.463487710749337 
-80.335178053376367,25.460882423663147 
-80.331488118928959,25.451534594814571 -80.33059712016518,25.449277399174147 
-80.330244897968313,25.448385103427441 -80.32815241876726,25.443084159001668 
-80.320442335058942,25.437153320075346 -80.326293659452972,25.42311015060093 
-80.32637317398526,25.422919315846702 -80.326363770725649,25.422524377849669 
-80.32578009239127,25.398009819939741 -80.320442335058942,25.391485899419418 
-80.311767773492065,25.389955099672015 
-80.310359913481463,25.389706654637418 
-80.306801412424306,25.384368897305098 
-80.309626872855929,25.375421616584809 
-80.310359913481463,25.373100324032777 
-80.310408767342054,25.373032859172842 
-80.315966309167067,25.365358158007869 
-80.335269409388431,25.338701493888912 
-80.339148313002624,25.336695164656742 -80.352468833080223,25.32980524124601 
-80.361661626520132,25.327432910560077 
-80.365543313308294,25.324290590637091 
-80.371587571117729,25.319397616842259 
-80.374116374473616,25.317350488982598 
-80.383012609876772,25.301337228478793 
-80.385978029339938,25.288289410424472 
-80.419190713535542,25.263379903024347 
-80.437953762474933,25.253000346505615 
-80.447065617412505,25.247959747100868 
-80.463301185393433,25.235899034578026 
-80.467823542161469,25.232539568191065 
-80.468339089797141,25.232004191659772 
-80.469164531631392,25.231147001837861 
-80.483243703831533,25.216526319180421 
-80.487404785979038,25.208202655178987 
-80.487888849732698,25.207234353208989 
-80.488034999999996,25.206942000000002 
-80.495340999999996,25.199463000000002 -80.498643999999999,25.20015 
-80.508112999999994,25.206719 -80.51292787379117,25.216718518018503 
-80.52035902709018,25.220787958131179 -80.523189948510435,25.220080231204825 
-80.528142002134857,25.217346933751084 
-80.530207049906579,25.216207125856343 
-80.540947312280394,25.218209546578613 
-80.542039546896405,25.221850312169593 
-80.540947312280394,25.224944967507884 
-80.540765277881263,25.229677967714881 
-80.548491264988002,25.236534933673255 -80.55822253422636,25.239011977915499 
-80.570784724885002,25.239365841378678 
-80.589185679829612,25.223795807854323 
-80.587593290816599,25.207694972277782 -80.584771000000003,25.200665 
-80.584901359310223,25.20056651936158 -80.594090364680397,25.193624636087332 
-80.601831907611952,25.187776246057229 
-80.609524775190991,25.181964628082632 -80.609609000000006,25.181901 
-80.618949581527019,25.177364146115444 
-80.619023999999996,25.177327999999999 
-80.634005764439294,25.176828866348735 -80.640275000000003,25.17662 
-80.645444203028006,25.17420546871362 -80.645821999999995,25.174029 
-80.646999630377337,25.172201595147918 
-80.648159315950423,25.170402036403559 
-80.649251000000007,25.168707999999999 
-80.656960751301327,25.168214881157731 -80.660822933427596,25.16796785441143 
-80.669865751472742,25.167389472075733 
-80.674738043856649,25.167077838264778 -80.679589303982794,25.16676754968562 
-80.683909282770273,25.166491242077882 
-80.688360670732123,25.164710702420276 
-80.695037744048719,25.157588483406542 
-80.701269680294374,25.146682586350472 
-80.703717938497675,25.139115238891979 
-80.715098999999995,25.140872000000002 -80.721885999999998,25.145101 
-80.726261645265595,25.144589246909291 
-80.742876999999993,25.142645999999999 
-80.746378534470267,25.148558534055216 
-80.746264219852947,25.155302985715871 
-80.751865547492656,25.163762125623183 
-80.757581180888778,25.166734256938565 
-80.795605295908445,25.172359126050114 -80.796218892419205,25.17244989476514 
-80.815323389458456,25.164904244132444 
-80.826123893828637,25.160638398637172 -80.826530000000005,25.160478 
-80.826664427363752,25.160770180023476 
-80.828430166264368,25.164608041743552 
-80.829882165974666,25.167763986319368 -80.830033999999998,25.168094 
-80.830436492347019,25.168422999297942 
-80.838227000000003,25.174790999999999 -80.846395,25.17706 
-80.858166999999995,25.176576 -80.858134000000007,25.211297999999999 
-80.857990999999998,25.242998 -80.861891,25.242998 -80.861998,25.26996 
-80.862189999999998,25.364194 -80.873189999999994,25.363994000000002 
-80.873490000000004,25.459795 -80.873099999999994,25.805606999999998 
-80.873572999999993,25.908301000000002 -80.872945,25.979434

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to