0

I want to be able to reproject the current layer's CRS onto the map canvas' CRS. I am using the C++ library with Qt. I have enable the OTF CRS transformation by calling

setCrsTransformEnabled(true);

I then set the Map Canvas's CRS using

mapCanvas->setDestinationCrs(selector->getSelectedCRS());

where selector lets you select the target CRS and mapCanvas is an instance of QgsMapCanvas. However, once this is called, the current layer disappears. I have tried to reset the extents using setExtent() and refresh().

What am I missing?

1

I have spent many hours solving the same problem! It happend on QGIS 2.18.20. After downgrade to 2.14.10 everything`s ok! OTF working fine))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.