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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more