Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用gmap3 jquery插件从Kmlayer获取标记?_Jquery_Google Maps_Kml_Google Maps Markers_Jquery Gmap3 - Fatal编程技术网

使用gmap3 jquery插件从Kmlayer获取标记?

使用gmap3 jquery插件从Kmlayer获取标记?,jquery,google-maps,kml,google-maps-markers,jquery-gmap3,Jquery,Google Maps,Kml,Google Maps Markers,Jquery Gmap3,我正在使用jquery插件gmap3和Kmlayer。如何从kml获取标记?。我需要按区域过滤标记您无法访问Kmlayer中的标记(它由Google的服务器呈现为地图分幅)。您可以使用FusionTableLayer(您可以将KML导入FusionTable,然后将查询修改为该FusionTable以过滤标记)或第三方KML解析器,如or(使用本机Google Maps v3对象呈现KML)。不确定他们中是否有人使用gmap3 var klms = [{"url":"http:\/\/examp

我正在使用jquery插件gmap3和Kmlayer。如何从kml获取标记?。我需要按区域过滤标记

您无法访问Kmlayer中的标记(它由Google的服务器呈现为地图分幅)。您可以使用FusionTableLayer(您可以将KML导入FusionTable,然后将查询修改为该FusionTable以过滤标记)或第三方KML解析器,如or(使用本机Google Maps v3对象呈现KML)。不确定他们中是否有人使用gmap3

var klms = [{"url":"http:\/\/example.com\/points_in_a_kml_file.kml"}];

if(klms){
    $.each(klms, function(i, klms){
        $('#map').gmap3({
            action: 'addKmlLayer',
            url: klms.url,
            options:{
                suppressInfoWindows: true,
                preserveViewport:  false
            }
        })
    })
}
“文件.kml中的点”:


http://example.com/pin.png
普劳韦胡角
妈妈的
<?xml version="1.0" encoding="UTF-8"?>
<Document>
<Style id="style0">
    <IconStyle scale="0.181818">
        <Icon>
            <href>http://example.com/pin.png</href>
        </Icon>
    </IconStyle>
</Style>
<Folder>
    <name>pulau_weh_point</name>
    <Placemark>
        <name>Mama's</name>
        <description><![CDATA[Point's description]]></description>
        <Point>
            <coordinates>95.255227,5.875082,0.000000</coordinates>
        </Point>
        <styleUrl>#style0</styleUrl>
    </Placemark>
</Folder>
</Document>