Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/382.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
如何使用javascript将iframe作为目标?(地图盒)_Javascript_Iframe_Leaflet_Mapbox - Fatal编程技术网

如何使用javascript将iframe作为目标?(地图盒)

如何使用javascript将iframe作为目标?(地图盒),javascript,iframe,leaflet,mapbox,Javascript,Iframe,Leaflet,Mapbox,我有一张地图,并创建了一个功能层,如下所示: window.map = L.mapbox.map('map', 'example.wefk232sm') .setView([homeLatitude, homeLongitude], initialZoom); var myLayer = L.mapbox.featureLayer().addTo(map); // Pass features to the map myLayer.setGeoJSON(geoJson); var geoJs

我有一张地图,并创建了一个功能层,如下所示:

window.map = L.mapbox.map('map', 'example.wefk232sm')
.setView([homeLatitude, homeLongitude], initialZoom);

var myLayer = L.mapbox.featureLayer().addTo(map);

// Pass features to the map
myLayer.setGeoJSON(geoJson);
var geoJson = {
    type: 'FeatureCollection',
    features: [
    {
    type: 'Feature',
    properties: {
        title: name,
        other: "text",
        'marker-color': '#54a743',
        'stroke': '#428334',
        url: link
    },
    geometry: {
        type: 'Point',
        coordinates: [longitude, latitude]
    }
]
}; 
geoJson对象如下所示:

window.map = L.mapbox.map('map', 'example.wefk232sm')
.setView([homeLatitude, homeLongitude], initialZoom);

var myLayer = L.mapbox.featureLayer().addTo(map);

// Pass features to the map
myLayer.setGeoJSON(geoJson);
var geoJson = {
    type: 'FeatureCollection',
    features: [
    {
    type: 'Feature',
    properties: {
        title: name,
        other: "text",
        'marker-color': '#54a743',
        'stroke': '#428334',
        url: link
    },
    geometry: {
        type: 'Point',
        coordinates: [longitude, latitude]
    }
]
}; 
我可以通过以下方式访问它:

myLayer.setGeoJSON(geojson);
myLayer.on('click', function(e) {
    window.open(e.layer.feature.properties.url);
});
当我点击地图上的标记时,url会在一个新窗口中打开。我试图实现的是在一个单独的iframe中打开url

<iframe width="100%" height="700px" frameborder="0" scrolling="no" 
name="side" id="side" src="frame_start.php?((parameters in the link))">Your    
Browser does not support iframes</iframe> 
您的
浏览器不支持iFrame

。。。但我不知道怎么做。有人能帮我吗?非常感谢您抽出时间

使用iframe的
名称
作为
打开
的第二个参数:

 window.open(e.layer.feature.properties.url,'side');

知道了!非常感谢:)