xuyao 发表于 2017-10-13 18:59:28

求教xyz驱动怎么写代码加载影像

osgEarth::Drivers::XYZOptions imagery;
                imagery.profile() = osgEarth::ProfileOptions("global-mercator");
                imagery.url() = osgEarth::URI("http://mt.google.cn/vt/lyrs=s&hl=zh-CN&gl=cn&&x={x}&y={y}&z={z}");
                osgEarth::ImageLayerOptions options("GoogleTest", imagery);
                options.cacheId() = "GoogleTest";
                osgEarth::ImageLayer* pImageLayer = new osgEarth::ImageLayer(options);
                m_pMapNode->getMap()->addImageLayer(pImageLayer);

上面的代码加载不了,请各位大神看下有什么问题

cll131421 发表于 2019-12-12 10:49:40

        osgEarth::Drivers::XYZOptions googleImageOption;
        googleImageOption.url() = "h ttp://mt.google.cn/vt/lyrs=y@258000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Ga";
        googleImageOption.profile() = osgEarth::ProfileOptions("global-mercator");
        osgEarth::ImageLayerOptions imageLayerOption(googleImageOption);


        osg::ref_ptr<osgEarth::ImageLayer> _googleImage = new osgEarth::ImageLayer("GoogleImageLayer", imageLayerOption);
        mapNode->getMap()->addImageLayer(_googleImage);
我用以上代码顺利加载谷歌地图

choa 发表于 2020-5-20 11:52:01

cll131421 发表于 2019-12-12 10:49
osgEarth:rivers::XYZOptions googleImageOption;
        googleImageOption.url() = "h ttp://mt.goog ...

感谢!

liyihongcug 发表于 2020-5-27 14:59:45

_format 这个要
页: [1]
查看完整版本: 求教xyz驱动怎么写代码加载影像