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

【bug】设置IconLayer的renderOrder比LineLayer的renderOrder高,但实际不生效,iso手机偶现、火狐浏览器必现 #152

Open
LiuJianhuo opened this issue Jun 19, 2023 · 1 comment

Comments

@LiuJianhuo
Copy link

LiuJianhuo commented Jun 19, 2023

设备:
操作系统:Mac Pro (Apple M1 Pro)
浏览器:fire fox(版本:114.0.1)

问题描述
设置IconLayer的renderOrder比LineLayer的renderOrder高,渲染结果是线遮挡了图层。
火狐浏览器版本114.0.1必现
iphone 6s plus手机偶现,软件版本15.7.1

代码:

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>MapVGL</title>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <style>
    html,
    body {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
    }

    #map_container {
        height: 100vh;
    }
    
    </style>
    <script type="text/javascript" src="https://api.map.baidu.com/api?type=webgl&v=1.0&ak=zLhopYPPERGtpGOgimcdKcCimGRyyIsh&services="></script>
    <script src="https://code.bdstatic.com/npm/[email protected]/dist/mapvgl.min.js"></script>

</head>
<body>
  <div id="map_container"></div>
   
   
  <script>
    var map = new BMapGL.Map('map_container');
    map.enableKeyboard();
    map.enableScrollWheelZoom();
    map.enableInertialDragging();
    map.enableContinuousZoom();

    const center = new BMapGL.Point(113,32)
    map.centerAndZoom(center,  0);
    
    const view = new mapvgl.View({
        map,
    });

        
    const lineLayer = new mapvgl.LineLayer({
      color: 'blue',
      renderOrder: 7,
    });

    const iconLayer = new mapvgl.IconLayer({
      color: 'red',
      icon: 'https://mapv.baidu.com/gl/examples/images/marker.png',
      renderOrder: 100,
    });


   
    lineLayer.setData([
      {
        geometry: {
          type: 'LineString',
          coordinates: [
            [120.403748, 39.915055],
            [110.403748, 39.925055],
          ],
        },
      },
    ]);

    iconLayer.setData([
      {
        geometry: {
          type: 'Point',
          coordinates: [116.403748, 39.915055],
        },
      },
    ]);

    view.addLayer(lineLayer);
    view.addLayer(iconLayer);
</script>

</body>
</html>
@zhuyuesen
Copy link

+1, 你怎么解决的 我也遇到了

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

No branches or pull requests

2 participants