在 Leaflet 中合并使用谷歌中国卫星图和高德地图

<div id="map"></div>
    <script>
        var map = L.map("map", {
            center: [39.904983,116.427287],
            zoom: 3,
            zoomControl: false
        }).setMaxBounds([[-90,0],[90,360]]);
        var mapLayers = {
            '谷歌高德杂交/卫星':L.layerGroup([
                    L.tileLayer('//www.google.cn/maps/vt?lyrs=s@189&gl=cn&x={x}&y={y}&z={z}', {
                    maxZoom: 20,
                    minZoom: 3,
                    attribution: "谷歌提供卫星图,高德提供街道图"
                }),
                L.tileLayer('//webst0{s}.is.autonavi.com/appmaptile?style=8&x={x}&y={y}&z={z}', {
                    maxZoom: 20,
                    maxNativeZoom: 18,
                    minZoom: 3,
                    attribution: "谷歌提供卫星图,高德提供街道图",
                    subdomains: "1234",
                    opacity:0.5
                })
            ]).addTo(map),
            '高德/卫星':L.layerGroup([
                L.tileLayer('//webst0{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}', {
                    maxZoom: 20,
                    maxNativeZoom: 18,
                    minZoom: 3,
                    attribution: "高德地图 AutoNavi.com",
                    subdomains: "1234"
                }),
                L.tileLayer('//webst0{s}.is.autonavi.com/appmaptile?style=8&x={x}&y={y}&z={z}', {
                    maxZoom: 20,
                    maxNativeZoom: 18,
                    minZoom: 3,
                    attribution: "高德地图 AutoNavi.com",
                    subdomains: "1234",
                    opacity:0.5
                })
            ]),
            '高德/街道':L.tileLayer('//webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}', {
                maxZoom: 20,
                maxNativeZoom: 18,
                minZoom: 3,
                attribution: "高德地图 AutoNavi.com",
                subdomains: "1234"
            }),
            '谷歌/卫星':L.tileLayer('//www.google.cn/maps/vt?lyrs=s@189&gl=cn&x={x}&y={y}&z={z}', {
                maxZoom: 20,
                minZoom: 3,
                attribution: "谷歌 Google.cn"
            }),
            '谷歌/街道':L.tileLayer('//www.google.cn/maps/vt?lyrs=m@189&gl=cn&x={x}&y={y}&z={z}', {
                maxZoom: 20,
                minZoom: 3,
                attribution: "谷歌 Google.cn"
            }),
            '智图/街道':L.tileLayer('//map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}', {
                maxZoom: 20,
                maxNativeZoom: 16,
                minZoom: 3,
                attribution: "智图 GeoQ.cn"
            })
        }
        var layerControl = L.control.layers(mapLayers, {}, {
            position: 'topright',
            collapsed: true
        }).addTo(map);
        L.control.zoom({
            zoomInTitle: '放大',
            zoomOutTitle: '缩小'
        }).addTo(map);
    </script>
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
PCL(Point Cloud Library)是一个开源的、跨平台的点云处理框架,它提供了大量的点云处理算法和工具,其之一就是 Out-of-Core(OOC)模块。OOC模块可以在内存不足的情况下处理大规模点云数据,它将点云数据分成多个块(chunks)进行处理,每个块可以被存储到硬盘上,不需要全部加载到内存。 Out-of-Core模块的源代码位于PCL库的pcl/outofcore目录下,它包含了多个类和文件,其最核心的是OutofcoreOctree类。下面是OutofcoreOctree类的主要代码结构和功能解析: 1. 类定义: ``` template<typename Container, typename PointT, typename LeafT> class OutofcoreOctreeBaseNode; template<typename Container, typename PointT, typename LeafT> class OutofcoreOctreeAbstractNode; template<typename Container, typename PointT, typename LeafT> class OutofcoreOctreeDiskContainer; template<typename Container, typename PointT, typename LeafT> class OutofcoreOctreeRamContainer; template<typename Container, typename PointT, typename LeafT> class OutofcoreOctreeBase; template<typename PointT, typename LeafT> class OutofcoreOctreeBaseNode<OutofcoreOctreeBase<OutofcoreOctreeDiskContainer<OutofcoreOctreeBaseNode<OutofcoreOctreeDiskContainer<PointT>, PointT, LeafT>, PointT, LeafT> >, PointT, LeafT>; template<typename PointT, typename LeafT> class OutofcoreOctreeBaseNode<OutofcoreOctreeBase<OutofcoreOctreeRamContainer<OutofcoreOctreeBaseNode<OutofcoreOctreeRamContainer<PointT>, PointT, LeafT>, PointT, LeafT> >, PointT, LeafT>; template<typename PointT, typename LeafT> class OutofcoreOctreeBase<OutofcoreOctreeDiskContainer<OutofcoreOctreeBaseNode<OutofcoreOctreeDiskContainer<PointT>, PointT, LeafT>, PointT, LeafT> >; template<typename PointT, typename LeafT> class OutofcoreOctreeBase<OutofcoreOctreeRamContainer<OutofcoreOctreeBaseNode<OutofcoreOctreeRamContainer<PointT>, PointT, LeafT>, PointT, LeafT> >; template<typename PointT, typename LeafT> class OutofcoreOctreeDiskContainer<OutofcoreOctreeBaseNode<OutofcoreOctreeDiskContainer<PointT>, PointT, LeafT>, PointT, LeafT>; template<typename PointT, typename LeafT> class OutofcoreOctreeRamContainer<OutofcoreOctreeBaseNode<OutofcoreOctreeRamContainer<PointT>, PointT, LeafT>, PointT, LeafT>; template<typename PointT, typename LeafT> class OutofcoreOctreeDiskContainer<boost::shared_ptr<OutofcoreOctreeBaseNode<OutofcoreOctreeDiskContainer<PointT>, PointT, LeafT> >, PointT, LeafT>; template<typename PointT, typename LeafT> class OutofcoreOctreeRamContainer<boost::shared_ptr<OutofcoreOctreeBaseNode<OutofcoreOctreeRamContainer<PointT>, PointT, LeafT> >, PointT, LeafT>; template<typename Container, typename PointT, typename LeafT> class OutofcoreOctreeBaseNode { }; template<typename Container, typename PointT, typename LeafT> class OutofcoreOctreeAbstractNode { }; template<typename Container, typename PointT, typename LeafT> class OutofcoreOctreeDiskContainer { }; template<typename Container, typename PointT, typename LeafT> class OutofcoreOctreeRamContainer { }; template<typename Container, typename PointT, typename LeafT> class OutofcoreOctreeBase { }; ``` 2. OutofcoreOctreeBaseNode类: OutofcoreOctreeBaseNode是OutofcoreOctree模块的最基本的节点类型,它是一个模板类,需要指定点云数据容器类型(Container)、点云类型(PointT)和叶子节点类型(LeafT)。OutofcoreOctreeBaseNode类定义了节点的基本属性和行为,例如节点的索引、节点的深度、节点的父节点和子节点等。OutofcoreOctreeBaseNode还提供了一些方法,如添加点云数据、获取包围盒等。 3. OutofcoreOctreeAbstractNode类: OutofcoreOctreeAbstractNode类是OutofcoreOctreeBaseNode类的基类,它定义了纯虚函数,需要在子类实现。OutofcoreOctreeAbstractNode类主要提供了节点的一些抽象方法,如获取节点的包围盒、获取节点的点云数据等。 4. OutofcoreOctreeDiskContainer类和OutofcoreOctreeRamContainer类: OutofcoreOctreeDiskContainer类和OutofcoreOctreeRamContainer类是点云数据容器类,它们分别用于处理硬盘存储和内存存储的点云数据。这两个类都继承自OutofcoreOctreeAbstractNode类,因此都需要实现OutofcoreOctreeAbstractNode类的纯虚函数。OutofcoreOctreeDiskContainer类和OutofcoreOctreeRamContainer类都提供了一些方法,如添加点云数据、获取包围盒等。 5. OutofcoreOctreeBase类: OutofcoreOctreeBase类是OutofcoreOctree模块的主要类,它是一个模板类,需要指定点云数据容器类型(Container)、点云类型(PointT)和叶子节点类型(LeafT)。OutofcoreOctreeBase类封装了OutofcoreOctreeBaseNode类和OutofcoreOctreeAbstractNode类的一些方法,提供了一些高级的功能,如点云数据的读取、写入、压缩、解压等。OutofcoreOctreeBase类还提供了一些方法,如获取节点、获取包围盒等。 总体来说,Out-of-Core模块的源代码结构比较复杂,涉及到多个类和文件,但其核心代码就是OutofcoreOctree类。OutofcoreOctree类的实现非常精简和高效,它通过将点云数据分块存储到硬盘上,实现了对大规模点云数据的高效处理。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值