如何在指南针上显示风向

AL̲*_*̲̳I 5 javascript jquery jquery-ui compass-geolocation

我正在开发一个Web应用程序,我必须显示温度,湿度,风速,风向等.我正在使用google.visualization.Gauge()来显示其他内容,但我想在指南针上显示风向.有没有人知道我可以用于网站/ webapp的任何(jQuery/javascript/etc)指南针?谢谢

sac*_*een 5

这是我使用CSS的方法.使用变换来旋转针.演示您还可以使用jQuery Rotate插件.

HTML

<div id="compass">
  <div id="arrow"></div>
</div>?
Run Code Online (Sandbox Code Playgroud)

CSS

#compass {
  width: 380px;
  height: 380px;
  background-image:url('http://i.imgur.com/44nyA.jpg');
  position: relative;
}
#arrow {
  width: 360px;
  height: 20px;
  background-color:#F00;
  position: absolute;
  top: 180px;
  left: 10px;
  -webkit-transform:rotate(120deg);
  -moz-transform:rotate(120deg);
  -o-transform:rotate(120deg);
  -ms-transform:rotate(120deg);

  -moz-transition: all 1s ease;
  -webkit-transition: all 1s ease;
  -o-transition: all 1s ease;
  transition: all 1s ease;
}

#compass:hover #arrow {
  -webkit-transform:rotate(0deg);
  -moz-transform:rotate(0deg);
  -o-transform:rotate(0deg);
  -ms-transform:rotate(0deg);
}?
Run Code Online (Sandbox Code Playgroud)