Make sure requested basemap exists before activating it

Oops! I have deleted my branch by mistake. Here is the new version of #407 with the correct base branch.