【发布时间】:2014-03-27 19:23:44
【问题描述】:
我在 my project 中使用 angular-google-maps。
我正在尝试使用以下定义的对象添加多个标记:
vehicles = [
{
stuff: "stuff",
last_known_location: {
latitude: number,
longitude: number
}
},
{
stuff: "stuff",
last_known_location: {
latitude: number,
longitude: number
}
},//...etc
]
我的指令看起来像:
<markers models='vehicles'
coords='vehicles.last_known_location' >
</markers>
Vehicles 是一个如上所述的对象数组。
这不起作用。如果我将模型更改为仅具有纬度和经度属性并完全丢失last_known_location 属性并更改我的指令coords='self',那么它可以正常工作。我需要做什么才能让这个与我的 json 结构一起工作?
【问题讨论】:
标签: javascript angularjs google-maps