Googleマップを使用する角度アプリを作成しようとしていて、その地図上に500から始まり毎秒100ずつ増加する半径を表示します。私はGithubから必要なものをすべてフォークし、ちょうど半径を操作しようとしています。毎秒角度関数が増加する
$scope.map.circle = {
id: 1,
center: center,
radius: 500,
//This function is not working, causes the radius to stop showing up on map
$interval: (function(){
$scope.map.circle.radius += 100;
}, 1000),
stroke: {
color: '#08B21F',
weight: 2,
opacity: 1
},
そして、私のHTML::半径を変更する機能を除いて
<ui-gmap-circle
center='map.circle.center'
radius='map.circle.radius'
fill='map.circle.fill'
stroke='map.circle.stroke'
clickable='map.circle.clickable'
draggable='map.circle.draggable'
editable='map.circle.editable'
visible='map.circle.visible'
events='map.circle.events'>
</ui-gmap-circle>
すべてが働いている
は、ここに私のjavascriptのコードです。
関数内でradius2を返すときに、コードの入力ミスをもう一度確認できますか? – amanpurohit
私は私の質問に示されているようにコードを置くと、ページはまったく動かないが、私は 'radius2'の代わりに 'radius'を返そうとしたが、それは役に立たなかった。 –
'window'プロパティはパラメータとして何を期待していますか? – Shomz