我想用谷歌地图v3,如果你放大高于15,地图显示标记位置,但当你缩小我想隐藏标记.我找不到任何功能来做到这一点.到目前为止,对我来说没有任何作用.
所以这是我的脚本:
<script type="text/javascript">
function initialize() {
var mapOptions = {
zoom: 15,
center: new google.maps.LatLng(52.429236, 6.281255),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
setMarkers(map, points);
google.maps.event.addListener(map, 'zoom_changed', function()
{
if (map.getZoom() > 15) {
setMarkers(map, points);
} else {
hideMarkers(map, points);
}
});
}
var points = [
['Location 1', 52.420891, 6.280204],
['Location 2', 52.420125, 6.279131],
['Location 3', 52.420125, 6.240125]
];
function setMarkers(map, locations) {
var image = new google.maps.MarkerImage('../images/map/beachflag.png',
new google.maps.Size(20, 32),
new google.maps.Point(0,0),
new google.maps.Point(0, …Run Code Online (Sandbox Code Playgroud) 我正在为我的图表使用jQuery Plot.我有一个列表,其中包含来自数据库的一些时间戳和值.
我想将我的时间戳转换为H:i:s格式.结果从10-05-2012 08:57:45到10-05-2012 09:03:40.
var rx = [[1336633065, 152], [1336633071, 152], [1336633076, 152], [1336633080, 153], [1336633086, 152], [1336633090, 152], [1336633095, 152], [1336633100, 152], [1336633105, 152], [1336633110, 150], [1336633115, 150], [1336633120, 152], [1336633125, 152], [1336633130, 150], [1336633135, 149], [1336633140, 153], [1336633145, 149], [1336633150, 152], [1336633155, 149], [1336633161, 149], [1336633165, 152], [1336633170, 152], [1336633175, 151], [1336633180, 150], [1336633185, 149], [1336633190, 151], [1336633195, 152], [1336633201, 152], [1336633205, 149], [1336633210, 151], [1336633215, 149], [1336633220, 151], [1336633225, 152], [1336633230, 149], [1336633235, 151], [1336633240, 152], …Run Code Online (Sandbox Code Playgroud)