谷歌融合,地图叠加层,并通过JavaScript数组打破了折线 [英] Google Fusion , Map Overlays and breaking out polyline via a javascript array
问题描述
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.
行:[
[
129
{
几何体:{
类型:多边形,
坐标:[
[
[
-86.3055326754,
39.8143343479,
0.0
]
[
-86.3056957826,
39.8139995783,
0.0
]
[
-86.3059116214,
39.8137158473,
0.0
]
[
-86.3055326754,
39.8143343479,
0.0
]
]
]
}
}
],等等...
"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....
折线如下:
行:[
[
1,
{
几何体:{
类型:LineString的,
坐标:[
[
-86.2411593096,
40.1368952707,
0.0
]
[
-86.2413739094,
40.1367194041,
0.0
]
[
-86.241866376,
40.1197924711,
0.0
]
]
}
}
]等。
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..
多边形具有通过数据来分析一个额外的[]被抛弃了我的能力!这是推动我疯了!严肃点,回答这个问题! 矿的例子这里。我只是不知道有足够的了解JavaScript数组。谢谢
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.geo$c$czip.com/v3_GoogleEx_FusionTables_mouseover_map_styles_polylines.html
我找不到期望的输出的任何文件或说明(不是以GeoJSON等),是否有检测多边形与折线与标记,并适当分析它们的方式这将是很好。
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.
下面是以GeoJSON
下面是一个网页,解析<一个href=\"http://www.geo$c$czip.com/v3_GoogleEx_FusionTables_generic_JSON_linkto.html?lat=39.923549&lng=-86.306907&zoom=10&type=m&tableid=1im8RszWUjZZhZdBnO8C0rfWGvT059O2EKk6TvZs&tablequery=SELECT%20%20geometry,%20GRID_$c$c%20FROM\"相对=nofollow>折线,<一个href=\"http://www.geo$c$czip.com/v3_GoogleEx_FusionTables_generic_JSON_linkto.html?lat=37.174668&lng=-38.845970&zoom=2&type=m&tableid=1foc3xO9DyfSIF6ofvN0kp2bxSfSeKog5FbdWdQ&tablequery=SELECT%20kml_4326,%20name%20FROM%20&where=name%20does%20not%20contain%20%27Antarctica%27\"相对=nofollow>多边形和<一个href=\"http://www.geo$c$czip.com/v3_GoogleEx_FusionTables_generic_JSON_linkto.html?lat=14.620282&lng=-90.504716&zoom=12&type=m&tablequery=SELECT%20geometry,%20name,%20description%20FROM&tableid=1npi-QWwoZ6LP_9wwHiwiG2omzMm6R9Qoj5aMjkM\"相对=nofollow>标记(没有得到很好的测试)。
Here is a page that parse polylines, polygons and markers (not well tested).
这篇关于谷歌融合,地图叠加层,并通过JavaScript数组打破了折线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!