美文网首页
React Native for Arcgis 地图开发 Lay

React Native for Arcgis 地图开发 Lay

作者: haibalai | 来源:发表于2022-12-13 15:06 被阅读0次

    针对图层管理LayerManager 比如之前的

    {

    "LayerId": "要素图层",

    "LayerType": "MapImageLayer",

    "ServerAddr": "https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0",

    "DefineInfo": {

    "Opacity": 0.8,

    "Priority": 5,

    "SubPriority": 10,

    "QueryFlag": true,

    "LoadFlag": false

    }

    }

    开启图层showLayer

    import {LayerManager} from '@haibalai/react-native-arcgis';

    LayerManager.showLayer('baseMap', "要素图层")..then((r: any) => {

    changeErrorContent('');

    changeContent(r);

    })

    .catch((error: any) => {

    changeErrorContent(error);

    });

    关闭图层hideLayer

    import {LayerManager} from '@haibalai/react-native-arcgis';

    LayerManager.hideLayer('baseMap', "要素图层"). .then((r: any) => {

    changeErrorContent('');

    changeContent(r);

    })

    .catch((error: any) => {

    changeErrorContent(error);

    });

    开启多个图层showLayers

    import {LayerManager} from '@haibalai/react-native-arcgis';

    LayerManager.showLayers('baseMap', ["要素图层", "要素图层1" ]);

    关闭多个图层hideLayers

    import {LayerManager} from '@haibalai/react-native-arcgis';

    LayerManager.hideLayers('baseMap', ["要素图层", "要素图层1" ]);

    设置显示隐藏

    ```

    import {LayerManager} from '@haibalai/react-native-arcgis';

    LayerManager.setVisible('baseMap', “要素图层1”, false)

    .then((r: any) => {

    changeErrorContent('');

    changeContent('' + r);

    })

     更多参考 https://xiaozhuanlan.com/topic/0843961527

    相关文章

      网友评论

          本文标题:React Native for Arcgis 地图开发 Lay

          本文链接:https://www.haomeiwen.com/subject/apmhqdtx.html