From 753595e507db7dcc7bc08998f277e56b4f3498b8 Mon Sep 17 00:00:00 2001 From: jumear <56776368+jumear@users.noreply.github.com> Date: Tue, 1 Oct 2024 02:14:53 -0500 Subject: [PATCH] Add files via upload --- iNat_map.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/iNat_map.html b/iNat_map.html index dc45535..8460069 100644 --- a/iNat_map.html +++ b/iNat_map.html @@ -749,18 +749,22 @@ var defaultzoom = winurlparams.get('defaultzoom'); var showtaxonplace = winurlparams.get('showtaxonplace') || 'false'; var showtaxonrange = winurlparams.get('showtaxonrange') || 'false'; +var showexpectednearby = winurlparams.get('showexpectednearby') || 'false'; var showplace = winurlparams.get('showplace') || 'false'; var view = winurlparams.get('view') || 'default'; var compexclparam = winurlparams.get('compare_exclude_param'); +var thresholded = winurlparams.get('thresholded') || 'true'; // even though the default in the API is false, set the default to true, since we're going to usually want to see Expected Nearby rather than Unthresholded winurlparams.delete('centerlat'); winurlparams.delete('centerlng'); winurlparams.delete('defaultzoom'); winurlparams.delete('showtaxonplace'); winurlparams.delete('showtaxonrange'); +winurlparams.delete('showexpectednearby'); winurlparams.delete('showplace'); winurlparams.delete('view'); winurlparams.delete('compare_exclude_param'); +winurlparams.delete('thresholded'); let compareurlparams = new URLSearchParams(winurlparams); if (compexclparam) { for (p of compexclparam.split(',')) { compareurlparams.delete(p); }; }; @@ -806,7 +810,7 @@ faddelem('p',div,null,null,'If a special "view" parameter is set to "=elevation", then the map will display with the USGS topo basemap (with contours in feet) by default, and the info pop-ups will include elevation (sourced from the '+furl('https://epqs.nationalmap.gov/','USGS elevation point query service')+'). USGS does not provide elevations outside of the United States. In cases where the USGS returns no data, the page will fall back to the '+furl('https://open-elevation.com/','Open-Elevation API')+'. As an example, if you want to see mountain goats in the United States, then you would navigate to '+furl(winurlexsearchstr+'?view=elevation&taxon_id=42414&place_id=1')+' in your web browser.'); faddelem('p',div,null,null,'If a special "view" parameter is set to "=ecolandunit", then the map will display with a USGS Ecological Land Unit overlay on a dark basemap by default, and the info pop-ups will include USGS ELU information (sourced from '+furl('https://www.usgs.gov/centers/geosciences-and-environmental-change-science-center/science/global-ecosystems','USGS Global Ecosystems')+'). This should work on any point of land worldwide. As an example, if you want to see maples around the world, then you would navigate to '+furl(winurlexsearchstr+'?view=ecolandunit&taxon_id=47727&defaultzoom=2')+' in your web browser.'); faddelem('p',div,null,null,'If a special "view" parameter is set to "=heatmap", then the map will show a heatmap view of observations on a muted-color basemap. By default, clicking the heatmap will not open a info pop-up. As an example, to get an idea of where user kueda has made observations, you would navigate to '+furl(winurlexsearchstr+'?view=heatmap&user_id=kueda')+' in your web browser.'); - faddelem('p',div,null,null,'If a special "view" parameter is set to "=subsetratio", then the map will compare a gridded view of one set of observations (the subset, defined in the URL) to another set (the superset, defined by a required special "compare_exclude_param" parameter, which removes one or more parameters from the subset parameter list). The color of the markers will vary based on the ratio of subset to superset for each cell (red=1.0 and blue=0.0), and they will appear on top of a gray basemap. As an example, to compare research grade plant observations to verifiable plant observations, you would navigate to '+furl(winurlexsearchstr+'?view=subsetratio&verifiable=true&quality_grade=research&taxon_id=47126&compare_exclude_param=quality_grade')+' in your web browser. Note that if you use exclusion filter parameters (ex. not_user_id) in your subset and remove them from the superset, then you may get unexpected results (because the subset would no longer be a true subset).'); faddelem('p',div,null,null,'There are 2 final sets of special parameters: centerlat, centerlng, and defaultzoom can be used to set the default map center and zoom level when the map is first opened; and showtaxonplace, showtaxonrange, showplace can be set to true to display specific layers by default.'); + faddelem('p',div,null,null,'If a special "view" parameter is set to "=subsetratio", then the map will compare a gridded view of one set of observations (the subset, defined in the URL) to another set (the superset, defined by a required special "compare_exclude_param" parameter, which removes one or more parameters from the subset parameter list). The color of the markers will vary based on the ratio of subset to superset for each cell (red=1.0 and blue=0.0), and they will appear on top of a gray basemap. As an example, to compare research grade plant observations to verifiable plant observations, you would navigate to '+furl(winurlexsearchstr+'?view=subsetratio&verifiable=true&quality_grade=research&taxon_id=47126&compare_exclude_param=quality_grade')+' in your web browser. Note that if you use exclusion filter parameters (ex. not_user_id) in your subset and remove them from the superset, then you may get unexpected results (because the subset would no longer be a true subset).'); faddelem('p',div,null,null,'There are 2 final sets of special parameters: centerlat, centerlng, and defaultzoom can be used to set the default map center and zoom level when the map is first opened; and showtaxonplace, showtaxonrange, showexpectednearby, and showplace can be set to true to display specific layers by default.'); } else { var mapdiv = faddelem('div',document.body,null,'mapid'); @@ -1012,6 +1016,9 @@ var l_inat_taxonplace = L.tileLayer(inat_urlbase+'taxon_places/'+taxon_id+'/{z}/{x}/{y}.png',{minZoom:2, maxZoom:20, attribution:'iNaturalist taxon place checklist data'}); var l_inat_taxonrange = L.tileLayer(inat_urlbase+'taxon_ranges/'+taxon_id+'/{z}/{x}/{y}.png',{minZoom:2, maxZoom:20, attribution:'iNaturalist taxon range data'}); + // Geomodel layers + var l_inat_geomodel = L.tileLayer(inat_urlbase+'geomodel/'+taxon_id+'/{z}/{x}/{y}.png?thresholded='+thresholded,{minZoom:2, maxZoom:20, attribution:'iNaturalist geomodel'}); + // Stamen layers // these are deprecated as Stamen tiles are now maintained by Stadia var s_stamen_copyright = 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.'; // used for all sets except Watercolor @@ -1134,6 +1141,7 @@ if (taxon_id!==null) { if (showtaxonplace==='true') {defaultlayers.push(l_inat_taxonplace)}; if (showtaxonrange==='true') {defaultlayers.push(l_inat_taxonrange)}; + if (showexpectednearby==='true') {defaultlayers.push(l_inat_geomodel)}; }; if (place_id!==null) { if (showplace==='true') {defaultlayers.push(l_inat_place)}; @@ -1219,6 +1227,7 @@ "EOX Overlay (Bright)": l_eox_overlay_bright, ...((taxon_id==null) ? {} : {"iNaturalist Taxon Range": l_inat_taxonrange}), ...((taxon_id==null) ? {} : {"iNaturalist Taxon Places": l_inat_taxonplace}), + ...((taxon_id==null) ? {} : (thresholded? {"iNaturalist Expected Nearby": l_inat_geomodel} : {"iNaturalist Unthresholded Geomodel": l_inat_geomodel})), ...((place_id==null) ? {} : {"iNaturalist Place": l_inat_place}), ...((compexclparam==null) ? {} : {"iNaturalist Subset Ratio (Red=1.0, Blue=0.0)": l_utfgrid_compare}), //"iNaturalist Observations Density in GBIF (no filters)": l_gbif,