zoukankan      html  css  js  c++  java
  • xxxxxxx

     
        <button id="vector_map_id" class="add_but" style="margin-left: 30px;">矢量地图</button>
     
        //添加建筑物模型
        var build3dmodel_map_flag = true;
        var build3dmodel_option = {
            url: 'http://220.171.42.86:8092//xj_building_3dtiles/3Dtiles/tileset.json'
        };
        var build3dModel = new smtmap.Build3DModel(build3dmodel_option);
        $('#build3dmodel_map_id').click(function(){
            if(build3dmodel_map_flag){
                map.addBuild3DModel(build3dModel);
                build3dmodel_map_flag = false;
            }else{
                map.removeBuild3DModel(build3dModel);
                build3dmodel_map_flag = true;
            }
        });
    
        
        //添加模型
        var model_options = {
            id: '100',
            name: 'first model',
            show: true,
            description: 'this is a model',
            position: [117, 40],
            model: new smtmap.ModelGraphics({
                uri: './smartmap/data/barrel.gltf',
                minimumPixelSize: 128,
                maximumScale: 20000
            })
        };
        var model = new smtmap.Entity(model_options);
        // map.addEntity(model);
    
        //添加geojson
        var geojson = {
            "type": "FeatureCollection",
            "features": [
                {
                    "type": "Feature",
                    "properties": {},
                    "geometry": {
                        "type": "Polygon",
                        "coordinates": [
                            [
                                [92.46726210481532, 37.35657108914954],
                                [93.77795102398596, 37.26959263167123],
                                [93.8025097123043, 36.647712158703705],
                                [92.7198752717614, 36.8584889310408],
                                [92.46726210481532, 37.35657108914954]
                            ]
                        ]
                    }
                },
                {
                    "type": "Feature",
                    "geometry": {
                        "type": "Point",
                        "coordinates": [95.301, 35.915]
                    },
                    "properties": {
                        "name": "Dinagat Islands"
                    }
                },
                {
                    "type": "Feature",
                    "properties": {},
                    "geometry": {
                        "type": "LineString",
                        "coordinates": [
                            [100.80517267883982, 33.52344778738012],
                            [101.8234853625771, 33.06028378604891],
                            [103.66536632020846, 32.92139892]
                        ]
                    }
                }
            ]
        }
        var options = {
            polygon:{
                color: new smtmap.Color(255, 0, 255, 100),
                outline: true,
                outlineColor: new smtmap.Color(100, 100, 100, 233)
            },
            point: {
                pixelSize: 10,
                fillColor: new smtmap.Color(20, 70, 50, 255),
                outlineColor: new smtmap.Color(233, 244, 2, 244),
                outlineWidth: 2,
                fontColor: new smtmap.Color(255, 255, 99, 233),
                showBackground: true,
                backgroundColor: new smtmap.Color(40, 99, 22, 150)
            },
            line:{
                 10,
                color: new smtmap.Color(250, 100, 200, 200)
            }
        };
        // map.addGeoJson(geojson, options);
     
  • 相关阅读:
    R学习 第二篇:矩阵和数组
    R学习 第一篇:变量和向量
    PowerBI开发 第七篇:数据集和数据刷新
    PowerBI开发 第八篇:查询参数
    PowerBI开发 第六章:数据网管
    专用管理连接(DAC)和单用户模式
    PowerBI开发 第五篇:关系和交互
    PowerBI开发 第四篇:DAX 表达式基础
    PowerBI开发 第三篇:报表设计技巧
    分区表介绍
  • 原文地址:https://www.cnblogs.com/chenghu/p/15414655.html
Copyright © 2011-2022 走看看