Published
Edited
Aug 22, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
html`
<img style="-webkit-user-select: none;margin: auto;background-color: hsl(0, 0%, 90%);" src= ${result.href}>
`
Insert cell
result.href
Insert cell
world_file=`
${(xmax - xmin)/(width - 1)}
0
0
-${(ymax - ymin)/(width - 1)}
${xmin}
${ymax}
`
Insert cell
cors_proxy = "https://observable-cors.glitch.me/"
Insert cell
image_data = fetch(
url_base + "?f=pjson"
).then((response) => response.json())
Insert cell
result = fetch(url_spec).then((response) => response.json())
Insert cell
url_spec = cors_proxy + url_base + "/export?bbox=" + xmin + "," + ymin + "," + xmax + "," + ymax + "bboxSR=" + sr + "," + "imageSR=" + sr +"&layers=show:" + "0" + "size=" + img_width + "," + img_height +"&format=" + "png" + "&transparent=true&dpi=&f=pjson"
Insert cell
xmin = image_data.fullExtent.xmin
Insert cell
xmax = image_data.fullExtent.xmax
Insert cell
ymin = image_data.fullExtent.ymin
Insert cell
ymax = image_data.fullExtent.ymax
Insert cell
sr = image_data.spatialReference.wkid
Insert cell
img_width = image_data.maxImageWidth
Insert cell
img_height = image_data.maxImageHeight
Insert cell
size = `${img_width}, ${img_height}`
Insert cell
layers = Object.keys(image_data.layers).join(", ")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more