唯杰地图 logo唯杰地图
VJMAP
EN

map-2d.vp.tsx

vjvp/examples/map-2d.vp.tsx 3.3 KB124 行
原文
/** @jsx h */
// AUTO-GENERATED by export-examples-tsx —— 由同名 .vpproj.json 导出的 VP-TSX 配对视图(已回编译等值验证)。
// 修改请改 JSON 后重跑导出脚本,或改本文件后用 compile.mts 重编 JSON——保持两者一致。
import { defineProject, h } from '../scripts/vptsx/runtime'

export default defineProject({
  name: "2D地图标记示例",
  connections: [
    {
      "uid": "conn_cities",
      "name": "城市数据",
      "type": "json",
      "connectorType": "json",
      "config": {
        "copyToRoot": true,
        "fileName": ""
      },
      "tables": [
        {
          "uid": "tbl_cities",
          "name": "城市数据",
          "fields": [
            {
              "uid": "city",
              "alias": "城市",
              "type": "string"
            },
            {
              "uid": "lng",
              "alias": "经度",
              "type": "number"
            },
            {
              "uid": "lat",
              "alias": "纬度",
              "type": "number"
            },
            {
              "uid": "value",
              "alias": "数值",
              "type": "number"
            }
          ]
        }
      ]
    }
  ],
  connectionData: {
    "conn_cities": [
      {
        "tableId": "tbl_cities",
        "tableName": "城市数据",
        "fields": [
          {
            "uid": "city",
            "alias": "城市",
            "type": "string"
          },
          {
            "uid": "lng",
            "alias": "经度",
            "type": "number"
          },
          {
            "uid": "lat",
            "alias": "纬度",
            "type": "number"
          },
          {
            "uid": "value",
            "alias": "数值",
            "type": "number"
          }
        ],
        "rows": [
          {
            "city": "北京",
            "lng": 116.41,
            "lat": 39.9,
            "value": 320
          },
          {
            "city": "上海",
            "lng": 121.47,
            "lat": 31.23,
            "value": 280
          },
          {
            "city": "成都",
            "lng": 104.07,
            "lat": 30.67,
            "value": 190
          },
          {
            "city": "广州",
            "lng": 113.26,
            "lat": 23.13,
            "value": 240
          }
        ]
      }
    ]
  },
  screen: (
    <screen
      uid={"screen_main"}
      name={"主页面"}
      fullscreen-mode={"fill-uniform"} fill-auto-expand={true}
      size={[1920,1080]}
      background-color={"#0c0d0e"}
      stateOverrides={{}}
    >
      <map-2d
        uid={"w_map"}
        name={"2D地图"}
        position={[0,0]}
        size={[1894,1078]}
        pieces={[{"uid":"map-body","type":"map-body","name":"场景","enabled":true,"options":{"coordinate-system":"geographic","basemap":"gaode-vec","map-center":[104.07,30.67],"map-zoom":4.2},"stateOverrides":{}},{"uid":"p_markers","type":"map-circle","name":"城市点","enabled":true,"options":{"point-color":"#ffd666","point-radius":8,"marker-lng":[["conn_cities","tbl_cities","lng"]],"marker-lat":[["conn_cities","tbl_cities","lat"]],"marker-name":[["conn_cities","tbl_cities","city"]],"marker-value":[["conn_cities","tbl_cities","value"]]},"stateOverrides":{}}]}
        stateOverrides={{}}
      />
    </screen>
  ),
})