MapDetail.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. namespace common\widgets\map;
  3. use Yii;
  4. use yii\base\Widget;
  5. /**
  6. * 地图经纬度选择器
  7. *
  8. * Class Map
  9. * @package common\widgets\map
  10. * @author jianyan74 <751393839@qq.com>
  11. */
  12. class MapDetail extends Widget
  13. {
  14. public $title = '骑行路径';
  15. /**
  16. * 秘钥
  17. *
  18. * @var string
  19. */
  20. public $secret_key = '';
  21. /**
  22. * 类型
  23. *
  24. * 默认高德
  25. *
  26. * amap 高德
  27. * tencent 腾讯
  28. * baidu 高德
  29. *
  30. * @var string
  31. */
  32. public $type = 'amap';
  33. public $start = [
  34. 'label' => '',
  35. 'lng' => '',
  36. 'lat' => '',
  37. ];
  38. public $end = [
  39. 'label' => '',
  40. 'lng' => '',
  41. 'lat' => '',
  42. ];
  43. /**
  44. * @return string
  45. * @throws \Exception
  46. */
  47. public function run()
  48. {
  49. return $this->render('detail/index', [
  50. 'title' => $this->title,
  51. 'start' => $this->start,
  52. 'end' => $this->end,
  53. 'label' => $this->label,
  54. 'type' => $this->type,
  55. 'secret_key' => $this->secret_key,
  56. ]);
  57. }
  58. }
粤ICP备19079148号