Base Tiles from the USGS, Radar Overlay from Environment Canada
Mix.install([
{:plotly_ex, "~> 0.3"},
{:kino, "~> 0.18"}
])
Section
Multiple entries in layout.map.layers stack in order — first entry is bottom-most.
Here the USGS topo map is the base, and the Environment Canada radar is the overlay.
Note: the radar layer is a live WMS service and may not always be available.
alias Plotly.{Figure, Scattermap}
Figure.new()
|> Figure.add_trace(
Scattermap.new(
lat: [45.4215],
lon: [-75.6972],
mode: "markers",
text: ["Ottawa"],
marker: %{size: 12, color: "yellow"}
)
)
|> Figure.update_layout(
title: "USGS Base + Environment Canada Radar Overlay",
map: %{
style: "white-bg",
center: %{lat: 47.0, lon: -85.0},
zoom: 4,
layers: [
%{
below: "traces",
sourcetype: "raster",
source: ["https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/{z}/{y}/{x}"],
opacity: 0.9
},
%{
below: "traces",
sourcetype: "raster",
source: ["https://geo.weather.gc.ca/geomet?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX={bbox-epsg-3857}&CRS=EPSG:3857&WIDTH=1000&HEIGHT=1000&LAYERS=RADAR_1KM_RDBR&TILED=true&FORMAT=image/png"],
opacity: 0.7
}
]
}
)
|> Plotly.show()