Skip to content

Commit

Permalink
Merge pull request #207 from USGS-WiM/staging
Browse files Browse the repository at this point in the history
Update master with new Print Task and latest Google Analytics
  • Loading branch information
njestes authored Jul 10, 2023
2 parents 779193e + 11f8a69 commit 961db84
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 32 deletions.
18 changes: 4 additions & 14 deletions build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,12 @@

<script src="scripts/combined.js"></script>

<script async src="https://www.googletagmanager.com/gtag/js?id=UA-8512252-5"></script>
<script>
window.dataLayer = window.dataLayer || [];
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-YCXV262N95"></script>
<script> window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-8512252-5');
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-8512252-5', 'auto');
ga('send', 'pageview');
gtag('config', 'G-YCXV262N95');
</script>

</head>
Expand Down
2 changes: 1 addition & 1 deletion build/scripts/combined.js

Large diffs are not rendered by default.

18 changes: 4 additions & 14 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,12 @@
<script src="scripts/core.js"></script>
<!-- endbuild -->

<script async src="https://www.googletagmanager.com/gtag/js?id=UA-8512252-5"></script>
<script>
window.dataLayer = window.dataLayer || [];
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-YCXV262N95"></script>
<script> window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-8512252-5');
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-8512252-5', 'auto');
ga('send', 'pageview');
gtag('config', 'G-YCXV262N95');
</script>

</head>
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ require([
//"legendLayers": [legendLayer]
var docTitle = template.layoutOptions.titleText;
printParams.template = template;
var printMap = new PrintTask("https://fwsprimary.wim.usgs.gov/server/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task");
var printMap = new PrintTask("https://fwsprimary.wim.usgs.gov/server/rest/services/ExportWebMap/GPServer/Export%20Web%20Map");
printMap.execute(printParams, printDone, printError);

$.get("https://fwsprimary.wim.usgs.gov/pdfLoggingService/pdfLog.asmx/Log?printInfo=" + map.getScale() + "," + map.extent.xmin + "," + map.extent.ymax + "," + map.extent.xmax + "," + map.extent.ymin + ",NWIV2", function(data) {
Expand Down Expand Up @@ -1841,8 +1841,8 @@ function stateSelected() {
if (select.selectedIndex > 0) {
var selectedVal = select.options[select.selectedIndex].value;
var selectedState = select.options[select.selectedIndex].label;
$('#downloadState').html("Download <a target='_blank' href='https://www.fws.gov/wetlands/Data/State-Downloads/" + selectedVal + "_geodatabase_wetlands.zip' onclick='ga(\"send\", \"event\", \"Downloads\", \"Digital Data\", \"" + selectedVal + " Geodatabase\");'>Geodatabase</a> and " +
"<a target='_blank' href='https://www.fws.gov/wetlands/Data/State-Downloads/" + selectedVal + "_shapefile_wetlands.zip' onclick='ga(\"send\", \"event\", \"Downloads\", \"Digital Data\", \"" + selectedVal + " Shapefile\");'>Shapefile</a> data for <b>" + selectedState + "</b>");
$('#downloadState').html("Download <a target='_blank' href='https://www.fws.gov/wetlands/Data/State-Downloads/" + selectedVal + "_geodatabase_wetlands.zip' onclick='gtag(\"send\", \"event\", \"Downloads\", \"Digital Data\", \"" + selectedVal + " Geodatabase\");'>Geodatabase</a> and " +
"<a target='_blank' href='https://www.fws.gov/wetlands/Data/State-Downloads/" + selectedVal + "_shapefile_wetlands.zip' onclick='gtag(\"send\", \"event\", \"Downloads\", \"Digital Data\", \"" + selectedVal + " Shapefile\");'>Shapefile</a> data for <b>" + selectedState + "</b>");
} else {
$('#downloadState').html("");
}
Expand Down

0 comments on commit 961db84

Please sign in to comment.