osgearth icon indicating copy to clipboard operation
osgearth copied to clipboard

osgearth XYZImageLayer can not load online map in https protocol

Open super3s1988 opened this issue 1 year ago • 1 comments

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

super3s1988 avatar Aug 29 '22 07:08 super3s1988

Check that your libCURL is built with SSL support, which is necessary to support the HTTPS protocol.

gwaldron avatar Aug 29 '22 12:08 gwaldron