kk Blog —— 通用基础


date [-d @int|str] [+%s|"+%F %T"]
netstat -ltunp
sar -n DEV 1

腾讯地图--静态地图API

https://lbs.qq.com/service/staticV2/staticGuide/staticDoc#9

图标(markers)

1
2
3
4
5
6
7
8
9
10
11
	echo "<td>";
	$mstr = "&markers=" . $latitude . "," . $longitude;
	$labels = "";
	$et = date('H时i分', strtotime($row->jstime));
	$labels = "&labels=color:0xff0000|bgcolor:0x00ff00|位置{$et}|" . $latitude . "," . $longitude;
	$zoom = ($data['zoom'] == '') ? "" : "&zoom={$data['zoom']}";
	$key = "key";
	$url = "https://apis.map.qq.com/ws/staticmap/v2/?size={$data['size']}{$zoom}&key={$key}{$mstr}{$labels}";
	$pstr = sprintf("<input type=button style='width:40px;vertical-align:baseline;color:blue;' value='%s' onclick=\"showimg('%s','%s')\">", '预览', $url, $row->jstime);
	echo $pstr;
	echo "</td>";

文本(labels) 路径(path)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

  if (!empty($path)) {
      $pn = count($path);
      if ($pn == 1) {
          $path[] = $path[0];
          $jstime[] = $jstime[0];
          $pn ++;
      }

      $mstr = "&markers=" . $path[0] . "|" . $path[$pn - 1];

      //$path = array_reverse($path);
      $pathstr = "weight:3|" . implode('|', $path);

      $labels = "";
      if ($pn > 1) {
          $st = date('H点i', strtotime($jstime[$pn-1]));
          $et = date('H点i', strtotime($jstime[0]));
          $labels = "&labels=color:0xff0000|bgcolor:0x00aa00|起{$st}|{$path[$pn-1]}|止{$et}|{$path[0]}";
      }

      $zoom = ($data['zoom'] == '') ? "" : "&zoom={$data['zoom']}";

      $key = "key";
      $url = "https://apis.map.qq.com/ws/staticmap/v2/?size={$data['size']}{$zoom}&key={$key}&path={$pathstr}{$mstr}{$labels}";

      echo "<script> document.getElementById('imgid0').src = '{$url}'; </script>";

      $sm = strtotime($jstime[$pn-1]);
      $em = strtotime($jstime[0]);
      $mm = (int)(($em - $sm) / 60);
      $ss = (int)($em - $sm) % 60;
      $vv = ($em - $sm != 0) ? round($g1s / ($em - $sm), 2) : 0;
      $dstr= "耗时{$mm}分{$ss}秒; 速度{$vv}米/秒; 路程{$g1s}米; 直线{$disD}米";
      echo "<script> document.getElementById('sid').innerHTML = '{$dstr}'; </script>";
  }

language, web

« JS 保持屏幕常亮 钉钉开放平台API »