如何使用KML导出的数据在谷歌地图上创建路线?

时间:2014-03-19 02:28:21

标签: javascript html5 google-maps google-maps-api-3 kml

我使用Google Map引擎在地图上创建一条路线,标记和线串穿过标记(链接:https://mapsengine.google.com/map/edit?mid=z0-DS05yFIOY.kk3gqtVGUw90)。然后我将数据导出到(kml)文件中。我现在要做的就是使用以下信息创建动态路线,例如当有人点击我网站上的按钮时的Lat / Long坐标。我正在使用HTML5,CSS3和JavaScript构建移动应用程序。我最初的想法是使用KML解析器将坐标信息保存在数据库中以解析KML文件。一旦我保存了坐标,我可以从我的javascript代码中调用它们吗?不确定这是我的问题的解决方案

<name>UFV To Peardonville and South Fraser   </name>
        <Placemark>
            <styleUrl>#icon-seq-0-0</styleUrl>
            <name>Stop 1- University of the Fraser Valley</name>
            <Point>
                <coordinates>-122.28257417678833,49.02859706469696,0.0</coordinates>
            </Point>
        </Placemark>
        <Placemark>
            <styleUrl>#icon-seq-0-1</styleUrl>
            <name>Stop 2 - Marshall and McCallum</name>
            <Point>
                <coordinates>-122.29326009750366,49.03969659484145,0.0</coordinates>
            </Point>
        </Placemark>

<Placemark>
            <styleUrl>#line-FF8277-7</styleUrl>
            <name>Line 8</name>
            <LineString>
                <tessellate>0</tessellate>
                <coordinates>-122.28205919265747,49.02870961988958,0.0 -122.281973361969,49.03145307396853,0.0 -122.29304552078247,49.031270181736296,0.0 -122.29298114776611,49.033211618811904,0.0 -122.29280948638916,49.03466061304994,0.0 -122.29257345199585,49.035012304315345,0.0 -122.29332447052002,49.0358563532078,0.0 -122.29334592819214,49.03985132363843,0.0 -122.2934103012085,49.04564627375429,0.0 -122.29032039642334,49.0456181445595,0.0 -122.29032039642334,49.0474605732066,0.0 -122.2902774810791,49.049049788878406,0.0 -122.29180097579956,49.04906385250716,0.0 -122.29519128799438,49.04933106069776,0.0 -122.30310916900635,49.05028737298155,0.0 -122.30478286743164,49.050498321744364,0.0 -122.30437517166138,49.05023111982696,0.0 -122.30448246002197,49.04684174982452,0.0 -122.30677843093872,49.04696832796101,0.0 -122.30982542037964,49.049387314870685,0.0 -122.30997562408447,49.05084990102674,0.0</coordinates>
            </LineString>
        </Placemark>

0 个答案:

没有答案