Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LabelLayer is unable to load large amounts of data #2398

Open
liangyuan1 opened this issue Sep 12, 2024 · 2 comments
Open

LabelLayer is unable to load large amounts of data #2398

liangyuan1 opened this issue Sep 12, 2024 · 2 comments
Assignees
Labels

Comments

@liangyuan1
Copy link

code

// 如果不是url,使用data接口数据
const twonSource = new itowns.FileSource({
url: '/data/point2.geojson',
crs: 'EPSG:4326',
format: 'application/json'
});

    const properties = {
      fill: '#eba55f',
      stroke: '#eba55f'
    };
    // 定义一个样式函数,该函数根据属性返回样式对象
    function getStyleFromProperties(properties) {
      cons.log('-------dsd----------', properties);
      // 基于属性动态创建样式
      const style = {
        fill: '#eba55f',
        stroke: '#eba55f'
      };

      return style;
    }

    const style = itowns.Style.setFromProperties(properties, {
      type: itowns.FEATURE_TYPES.POINT
    });

    const twonLayer = new itowns.LabelLayer('twon', {
      name: 'twonLayer',
      transparent: true,
      source: twonSource,
      // style: e => {
      //   console.log('-0-0-0-0-0-0-0:', e);
      // }
      // style: style

      style: {
        point: {
          color: 'red',
          //  e => {
          //   console.log(e);
          //   return ;
          // },
          line: 'red'
        },
        icon: {
          source: 'http://localhost:8080/data/1.png'
          // size: 100
        },
        fill: {
          color: 'orange',
          opacity: 0.5
        },
        stroke: {
          color: 'red'
          // e => {
          //   console.log(e);
          //   return ;
          // }
        }
      }
    });

    view.addLayer(twonLayer);

###result
ColorLayer cannot display icons when loading point data. LabelLayer can display icons when loading point data, but there is a noticeable lag when loading 1000 points on the page. Is there a good method to load icons efficiently and load at least 1000 points at the same time? Below is a rendering of the obvious lag when loading
image

@Desplandis
Copy link
Contributor

Can you provide a dataset to reproduce this issue?

@liangyuan1
Copy link
Author

liangyuan1 commented Oct 17, 2024

Can you provide a dataset to reproduce this issue?
@Desplandis
point.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants