Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/17.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
Vue.js 不推荐向Vue cli 3添加传单.timeline npm?TypeError:无法读取属性';左下角';未定义的_Vue.js_Leaflet_Geojson_Timeline_Vue Cli 3 - Fatal编程技术网

Vue.js 不推荐向Vue cli 3添加传单.timeline npm?TypeError:无法读取属性';左下角';未定义的

Vue.js 不推荐向Vue cli 3添加传单.timeline npm?TypeError:无法读取属性';左下角';未定义的,vue.js,leaflet,geojson,timeline,vue-cli-3,Vue.js,Leaflet,Geojson,Timeline,Vue Cli 3,我的问题不是检测未定义的对象属性。 我正在尝试使用npm向Vue cli 3添加传单.timeline。 我有一组功能(geoJSON),我正试图将它们添加到时间线中,但是L.timeline会引发错误: TypeError:无法读取未定义的属性“bottomleft” 在传单内。时间线模块 是图书馆被弃用了,还是我遗漏了什么 从“传单”导入*为L 导入“传单.时间表” 进口“传单.markercluster” 导入“传单.markercluster.图层支持” 导入“传单.markerclu

我的问题不是检测未定义的对象属性。 我正在尝试使用npm向Vue cli 3添加传单.timeline。 我有一组功能(geoJSON),我正试图将它们添加到时间线中,但是L.timeline会引发错误:

TypeError:无法读取未定义的属性“bottomleft”

在传单内。时间线模块

是图书馆被弃用了,还是我遗漏了什么

从“传单”导入*为L
导入“传单.时间表”
进口“传单.markercluster”
导入“传单.markercluster.图层支持”
导入“传单.markercluster/dist/markercluster.css”
导入“传单.markercluster/dist/markercluster.Default.css”
进口“传单.加热”
导入“传单分组图层控制”
导入“传单groupedlayercontrol/dist/传单.groupedlayercontrol.min.css”
方法:{
createBookmarkTimeLine(){
var timeLine=L.timeLine(
{
类型:“FeatureCollection”,
功能:vm.bookmarks,
位置:'bottomleft',
enablePlayback:true,
getInterval:{
起点:1495647158,
完:1537799558
}
}
)
var timelineControl=L.timelineSliderControl({
格式化输出(){
让date=date().toString()
返回日期
},
持续时间:10万,
})
timelineControl.addTo(vm.bookmarkLayer)
timelineControl.addTimelines(时间线)
timeLine.addTo(vm.bookmarkLayer)
}
}
//vm.bookmarks内容:
// [
//         {
//“类型”:“功能”,
//“几何学”:{
//“类型”:“点”,
//“坐标”:[
//                     -47.88264281443456,
//                     -15.788079277798529
//                 ]
//             },
//“财产”:{
//“书签区域名称”:“PessoasAndando”,
//“书签\区域\摄像机\名称”:“PTZ \ 1”,
//“开始时间”:“2018-09-24T14:12:41Z”,
//“结束时间”:“2018-09-24T14:13:01Z”,
//“日期”:“2018-09-24T14:12:41Z”,
//“对象类型”:“人”,
//“对象id”:26560226,
//“像素开始位置”:“[1168.0,116.0]”,
//“像素结束位置”:“[892.0268.0]”,
//“事件id”:“1668531”,
//“设备id”:“70243c02-b030-11e6-8fa5-a41f725f89f6”,
//“书签区”:3
//             }
//         },
//         {
//“类型”:“功能”,
//“几何学”:{
//“类型”:“点”,
//“坐标”:[
//                     -47.88262034830791,
//                     -15.788017998552633
//                 ]
//             },
//“财产”:{
//“书签区域名称”:“PessoasAndando”,
//“书签\区域\摄像机\名称”:“PTZ \ 1”,
//“开始时间”:“2018-09-24T14:14:39Z”,
//“结束时间”:“2018-09-24T14:14:59Z”,
//“日期”:“2018-09-24T14:14:39Z”,
//“对象类型”:“人”,
//“对象id”:26560296,
//“像素开始位置”:“[860.0440.0]”,
//“像素结束位置”:“[944.0590.0]”,
//“事件id”:“1668539”,
//“设备id”:“70243c02-b030-11e6-8fa5-a41f725f89f6”,
//“书签区”:3
//             }
//}]

您正在将geoJSON参数对象与timeline参数对象混合。您只需将它们分开。将代码更改为此,它应该可以工作:

vm.bookmarkTimeLine = L.timeline(
       {
         type: "FeatureCollection",
         features: vm.bookmarks, 
       },
       {
         pointToLayer: vm.bookmarkMarkerOptions,
         onEachFeature: vm.addBookmarkPopUp
       }
     )
您还需要将时间线添加到地图,而不是图层:

timelineControl.addTo(myMap)
timelineControl.addTimelines(vm.bookmarkTimeLine)
vm.bookmarkTimeLine.addTo(myMap)