I have a map in OpenLayers 3 with raster and GeoJSON layers that are in an UTM projection and I would like to use MapQuest tiles as a base map while keeping the map and layers projected as UTM. Is this possible? I'm using proj4.js to define the UTM projection for the map if that makes any difference. The raster layers are being pulled from a WMS service.
2 Answers
Starting with OpenLayers 3.11.0, raster image sources can now be reprojected, see the release notes.
As per the respective pull request, OpenLayers handles the reprojection automatically if you specify the (different) projections on both the view and the raster source.
You simply can't because it's not possible for the browser to reproject images from Spherical Mercator (MapQuest) to UTM at the moment. You will need an intermediate server to reproject MapQuest tiles like Mapproxy. Be aware that tiles with labels, with reprojection deformation, will be less readable. FYI, Proj4.js is useful only to reproject vector layers.
There are plans to be able to reproject tiles on client side. See the ol3-dev list discussion about this.
Edit due to OpenLayers 3 evolution:
As stated by @theDmi from OpenLayers 3.11.0, raster image sources reprojection support is now available. You will have the same issue here with labels as stated above.