0
我試圖在angularjs應用程序中添加polymaps映射。Polymaps和Angularjs
TypeError: Object [object Object] has no method 'setAttribute'
at Object.a.container (http://localhost:8000/lib/polymaps.min.js:15:341)
at new <anonymous> (http://localhost:8000/js/controllers.js:22:4)
at d (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:33:335)
at Object.instantiate
(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:33:464)
at http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:65:486
at link (http://localhost:8000/lib/angular-route.min.js:7:248)
at J (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:52:492)
at h (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:46:28)
at http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:45:200
at http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:46:431 <div ng-view="" class="ng-scope">
Javascript無法在我的角度視圖內的元素上設置屬性?
我的HTML看起來像這樣:
<article class="dashboard container">
<div id="map"></div>
</article>
的基本polymaps代碼:
var po = org.polymaps;
var map = po.map()
.container(document.getElementById("map").appendChild(po.svg("svg")))
.add(po.interact())
.add(po.hash());
.add(po.image().url(
po.url("http://{S}tile.openstreetmap.org" + "/{Z}/{X}/{Y}.png")
.hosts(["a.","b.","c.",""])))
.center({lat: -33.882957, lon: 151.073685})
.zoom(11);
我假設這是角。有什麼解決辦法嗎?