Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Screenshot fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AndresKasekamp committed Aug 21, 2023
1 parent 70a86a1 commit a4c4052
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
14 changes: 5 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,22 @@

<body>
<div id="viewDiv" class="esri-widget">
<button id="screenshotBtn" class="action-button2 esri-widget" aria-label="Select screenshot area"
title="Select screenshot area">
Select screenshot area
</button>

<div id="performanceInfo">
<h4 id="title"></h4>
<table id="memory"></table>
<table id="count"></table>
</div>
</div>

<button id="shadowCastBtn"
class="esri-icon-collection esri-widget--button esri-widget esri-icon-measure-building-height-shadow shadowcast-button"
<button id="shadowCastBtn" class=" esri-widget--button esri-icon-measure-building-height-shadow shadowcast-button"
aria-label="Shadow casting" title="Shadow cast"></button>

<button id="performanceMeasureBtn"
class="esri-icon-collection esri-widget--button esri-widget esri-icon-lightbulb shadowcast-button"
<button id="performanceMeasureBtn" class=" esri-widget--button esri-icon-lightbulb shadowcast-button"
aria-label="Perfomance measure" title="Performance measure"></button>

<button id="screenShotButton" class=" esri-widget--button esri-icon-share2 shadowcast-button"
aria-label="Take a screenshot" title="Take a screenshot"></button>

<div id="screenshotDiv" class="hide">
<img class="js-screenshot-image" />
<div>
Expand Down
10 changes: 6 additions & 4 deletions modules/screenShot.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
// TODO ilmselt teha on click eventiga hoopis ikooni peale vajutades kuidagi
define(["esri/widgets/Expand"], (Expand) => ({
setupScreenshot: (view) => {
// the button that triggers area selection mode
const screenshotBtn = document.getElementById("screenshotBtn");

// the orange mask used to select the area
const maskDiv = document.getElementById("maskDiv");

Expand All @@ -18,6 +15,9 @@ define(["esri/widgets/Expand"], (Expand) => ({
// the button to hide the print preview html element
const closeBtn = document.getElementById("closeBtn");

// the button that triggers area selection mode
const screenshotBtn = document.getElementById("screenShotButton");

const expandScreenShot = new Expand({
expandTooltip: "Screenshot",
view: view,
Expand All @@ -27,8 +27,10 @@ define(["esri/widgets/Expand"], (Expand) => ({
expandIcon: "camera-plus",
});

view.ui.add(screenshotBtn, "top-left");

//view.ui.add(screenshotBtn, "top-right");
view.ui.add(expandScreenShot, "top-left");
//view.ui.add(expandScreenShot, "top-left");

// add an event listener to trigger the area selection mode
screenshotBtn.addEventListener("click", () => {
Expand Down

0 comments on commit a4c4052

Please sign in to comment.