osgearth
osgearth copied to clipboard
osgearth XYZImageLayer can not load online map in https protocol
osgEarth::Map* map = new osgEarth::Map();
osgEarth::URIContext context;
context.addHeader("Accept", "*/*");
context.addHeader("Accept-Encoding", "gzip, deflate, br");
context.addHeader("Connection", "keep-alive");
//url 1
osgEarth::URI uri("https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}", context);
//url 2
osgEarth::URI uri("http://[abc].tile.openstreetmap.org/{z}/{x}/{y}.png", context);
osgEarth::XYZImageLayer* layer = new osgEarth::XYZImageLayer();
layer->setProfile(osgEarth::Profile::create(osgEarth::Profile::SPHERICAL_MERCATOR));
layer->setURL(uri);
layer->setVisible(true);
map->addLayer(layer);
mapNode = new osgEarth::MapNode(map);
mViewer->setSceneData(mapNode);
mViewer->realize();
when i use url 1,the earth is white ,use url 2,the earth is right,i test many url ,the http protocol is ok,but the https protocol url the result is white earth,but the url can get data in chrome or postman tool
Check that your libCURL is built with SSL support, which is necessary to support the HTTPS protocol.