Hi sebastien,
For your first question, you could check the projection (or name) of base layer in the track ended event to see which projection the current map is in. The code is like this:
function DrawEnded(feature) {
// You could check some properties of baseLayer to see what projection the map is in.
alert(feature.layer.map.baseLayer.projection);
}
For the second question, the background overlay will not display if your custom wms overlay is not in Google projection when you switch from Google overlay. This is because the map unit and current extent that you set in the server side just matches with Google projection.
So I think the simplest solution of this problem is setting the same projection of your wms overlay as Google overlay, but if you don’t want to do this, then you may need to raise a post back to server side to change the map unit and current extent to match the projection of your custom wms overlay once you switch the background overlay, and then redraw the map. And you also can try to change these parameters in the client side, but you need to consider how to synchronize the state between server side and client side.
Any more questions please let me know.
Thanks,
Sun