{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "b6987dd1-138f-4443-acaa-7945a5fad3d3",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "234a1a1b78e445849d3a3579dd678252",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Map(center=[-90, 0], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_tex…"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# note that we need to use the same projection for the layer and the map.\n",
    "from ipyleaflet import (\n",
    "    Map,\n",
    "    basemaps,\n",
    "    TileLayer,\n",
    "    WMSLayer,\n",
    "    DrawControl,\n",
    "    projections,\n",
    ")\n",
    "\n",
    "m2 = Map(\n",
    "    center=(-90, 0),\n",
    "    zoom=0,\n",
    "    basemap=basemaps.Esri.AntarcticBasemap,\n",
    "    crs=projections.EPSG3031.ESRIBasemap,\n",
    ")\n",
    "\n",
    "# add draw control on Antarctic map\n",
    "dc2 = DrawControl(marker={\"shapeOptions\": {\"color\": \"#0000FF\"}})\n",
    "\n",
    "m2.add(dc2)\n",
    "        \n",
    "\n",
    "contours = TileLayer(\n",
    "    attribution=\"\"\"\n",
    "        NOAA National Centers for Environmental Information (NCEI);\n",
    "        International Bathymetric Chart of the Southern Ocean (IBCSO);\n",
    "        General Bathymetric Chart of the Oceans (GEBCO)\n",
    "        \"\"\",\n",
    "    transparent=True,\n",
    "    opacity=0.5,\n",
    "    url='https://tiles.arcgis.com/tiles/C8EMgrsFcRFL6LrL/arcgis/rest/services/antarctic_ibcso_contours/MapServer/tile/{z}/{y}/{x}',\n",
    "    crs=projections.EPSG3031.ESRIImagery\n",
    ")\n",
    "\n",
    "names = WMSLayer(\n",
    "    layers=\"1\",\n",
    "    format='image/png32',\n",
    "    transparent=True,\n",
    "    url='https://gis.ngdc.noaa.gov/arcgis/services/antarctic/reference/MapServer/WMSServer',\n",
    "    crs=projections.EPSG3031.ESRIImagery\n",
    ")\n",
    "\n",
    "m2.add(contours)\n",
    "\n",
    "m2.add(names)\n",
    "\n",
    "\n",
    "m2\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}