Coder Social home page Coder Social logo

Comments (6)

shadowings-zy avatar shadowings-zy commented on August 22, 2024

这个我来做好了,不过目前由于只有医院的信息,后续如果还有物资等信息的话,就需要再次进行修改。

from map-viz.

tongshuangwu avatar tongshuangwu commented on August 22, 2024

我们和前端尝试保持一致吧?我看到水歌发的:
医疗物资数据结构 同步完了
wuhan2020/rest-api@a15869c
常用医疗物资的静态数据也有了
wuhan2020/wuhan2020.github.io@dafa060
物流公司数据模型
https://github.com/wuhan2020/rest-api/blob/master/source/model/Logistics.ts
宾馆数据结构
https://github.com/wuhan2020/rest-api/blob/master/source/model/Hotel.ts
供应商数据结构
https://github.com/wuhan2020/rest-api/blob/master/source/model/Vendor.ts

为了通用就找个他们共有的几个属性,其他的都扔到metadata之类的,规定格式,然后传进来就直接显示就行了。比如:

interface GeoData {
  // 控制显示的icon和label name
  type: "hospital"|"hotel"|'logistic"|"vendor",
  
  // 显示名称
  name: string,
  // 坐标
  coord: [number, number],
  metadata: {
    key: string, 
    value: string, 
    // 如果是邮件/电话/网址可以有链接
    url?:  string 
  }
}

然后通用组件就接受GeoData[].
至于现在的

hospitalLabel: {
  // 有没有可能自动算一下initPoint和zoom,或者就固定?
  initPoint: [116.350658, 39.938285],
  zoom: 6,
   // 剩下这些我觉得应该咨询一下designer team,固定好了就写死,不留接口给外面~
   labelText: '医院',
    labelStyle: {
      color: 'white',
      backgroundColor: 'red',
      border: '0px'
    },
  }

from map-viz.

tongshuangwu avatar tongshuangwu commented on August 22, 2024

@shadowings-zy

from map-viz.

shadowings-zy avatar shadowings-zy commented on August 22, 2024

我看了一下水歌的数据格式,能显示在地图上的只有医院信息和宾馆信息。
其他的信息因为没有经纬度所以显示不了。
所以我们的GeoData中的type应该只有"hospital"|"hotel",
最后格式大概是这样子:
interface GeoData { type: "hospital"|"hotel" name: string, coord: [number, number], metadata: { key: string, value: string, url?: string } }

label的text和style可以咨询设计之后固定下来。
这样我觉得就ok了。

from map-viz.

tongshuangwu avatar tongshuangwu commented on August 22, 2024

我去问一下design以及确认一下是不是只有这两个需要做地图信息~

from map-viz.

tongshuangwu avatar tongshuangwu commented on August 22, 2024

我看了一下,那个metadata还是得给他们定一下格式的,要么就做医院和酒店两个interface,要么就写一个尽可能general的然后接受他们自己加别的option。这个我来看一下吧~

from map-viz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.