最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Get Google Map KML data in JSON format - Stack Overflow

programmeradmin3浏览0评论

Is there a way to get the KML file attached to this Google Map in JSON format instead of XML?:

I'm currently writing an app that needs to load this KML data. I would prefer that it's in JSON format. Is there a way of getting it in this format?

Is there a way to get the KML file attached to this Google Map in JSON format instead of XML?:

I'm currently writing an app that needs to load this KML data. I would prefer that it's in JSON format. Is there a way of getting it in this format?

Share Improve this question edited Nov 17, 2011 at 18:24 John Conde 220k99 gold badges462 silver badges501 bronze badges asked Nov 17, 2011 at 18:14 CamsoftCamsoft 12k20 gold badges85 silver badges124 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 7

Since KML is just a flavor of XML, you could use any XML to JSON converter, of which there are many.

Here's one that's been around for a few years: http://www.thomasfrank.se/xml_to_json.html

I was trying to convert KML files to JSON and it was the most useful tool I found to do it programmatically

https://github./mapbox/togeojson#using-it-as-a-console-utility

It is with nodejs, you should do something like that in the cli

togeojson file.kml > file.geojson

Then, you can pass it into a json quite easy

Anyway, hope this help

发布评论

评论列表(0)

  1. 暂无评论