문제

I have a simple google maps view which is a CollectionView and has a contentBinding to an array controller. Every time I set the content to a new set of objects by setting it to a new array the CollectionView which has the maps on is removed from the DOM. However, If I push objects to content it will work fine. I need to reset the content with a new array of data though as it will be coming from an API. Can someone please tell me why this is happening I've been trying to solve this for a good day now.

Here is a jsbin. You can uncomment the code within the 'refresh' method that I've described above to see it working / failing.

도움이 되었습니까?

해결책

Finally, I've found a solution. I created a ember component which applies the goole maps view to its self and then within the components view template add the collection view for the markers. Now I can refresh the data without it removing the google maps view. Please see this jsbin to see it working

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top