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?