My question is based on the following example from Google. I have gotten it to work great to pull out my polygon shapes from my fusion table, similar to their shapes. My issue arises when I try and alter the script to pull out some polyline data I have. The issue is in the breaking down of the rows data array. The dataset for the correct polygons is as follows.
“rows”: [
[
“129”,
{
“geometry”: {
“type”: “Polygon”,
“coordinates”: [
[
[
-86.3055326754,
39.8143343479,
0.0
],
[
-86.3056957826,
39.8139995783,
0.0
],
[
-86.3059116214,
39.8137158473,
0.0
],
[
-86.3055326754,
39.8143343479,
0.0
]
]
]
}
}
],etc….
The polylines is as follows
“rows”: [
[
“1”,
{
“geometry”: {
“type”: “LineString”,
“coordinates”: [
[
-86.2411593096,
40.1368952707,
0.0
],
[
-86.2413739094,
40.1367194041,
0.0
],
[
-86.241866376,
40.1197924711,
0.0
]
]
}
}
],etc..
The polygon has an extra [] that is throwing off my ability to parse through the data! It is driving me nuts! Serious points to answer this one! Example of mine here. I just dont know enough about javascript arrays. Thanks
Here is a version that only parses polylines:
http://www.geocodezip.com/v3_GoogleEx_FusionTables_mouseover_map_styles_polylines.html
I couldn’t find any documentation or description of the expected output (other than “GeoJSON”), it would be nice if there was a way to detect polygons vs. polylines vs. markers and parse them appropriately.
Here is a description of GeoJSON
Here is a page that parse polylines, polygons and markers (not well tested).