Select to view content in your preferred language

Using javascript switch method

893
7
Jump to solution
11-27-2017 05:36 PM
BrandonPrice
Occasional Contributor

Hello,

I am customizing a story map running on arcgis api 3.22. I am trying to use the switch javascript method to remove the basemap toggle on some of the tabs. This is what I have:

let tabs = $('.entries > .nav > .entry > .entryLbl ');
tabs.each(function (idx, liItem) {
switch (liItem.text) {
case 'Electric':
//liItem.on('click', function () {
// console.log('got a click on electric');
//});
liItem.setAttribute('title', 'To download a Los Angeles Substructure Plan: \n 1. Zoom to a substructure quad\n 2. Click the area inside the quad \n 3. Click "More info"');
break;
case 'Gas/Oil':
liItem.setAttribute('title', 'This tab contains non-hazardous gas/oil utilities. Visit our confidential \n gas/oil application at: http://sv07gis6/undergroundconfidential');
break;
case 'Sanitation':
liItem.setAttribute('title', 'Download LA City SanGIS Data in its entirety at:\n http://geohub.lacity.org/datasets?q=sewer \nDownload LACSD GIS Data in its entirety at:\n http://data-lacsdgis.opendata.arcgis.com');
break;
case 'Stormwater':
liItem.setAttribute('title', 'Download LA County Stormwater GIS Data in its entirety at: \n http://dpw.lacounty.gov/fcd/stormdrain/disclaimer.cfm \n and click "File Geodatabase Download"');
break;
case 'Download':
liItem.setAttribute('title', 'Use this tab to download snippets of all utility types within\n up to a 500-foot range in .shp or .dgn formats');
break;
case 'Resources':
liItem.setAttribute('title', 'Please contact D7GIS to help with our resources list');
break;
}
})

https://community.esri.com/community/gis/web-gis/storymaps?sr=search&searchId=78ff8351-2ac6-4ff5-aac...

-Brandon 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Brandon,

   I guess that does not help then as there is no basemap toggle in the public version. So basically you need to get the toggle dom node using it's id and then use dojo/dom-style to set the display to none.

View solution in original post

0 Kudos
7 Replies
RobertScheitlin__GISP
MVP Emeritus

Brandon,

   So what exactly is your question? Are you asking what code to put in the switch cases to remove the basemap toggle? Have you thought about using jQuery or Dojo to query the toggle button element and using style to set the dom elements display to none?

0 Kudos
BrandonPrice
Occasional Contributor

Yes I would like to know what code to use in the switch case to remove the basemap toggle since I already have a switch case in the app for the tooltips. I have not thought about jquery or dojo to query the toggle and using the style to set the dom elements display to none. Is that easy to do? Is that a simple css change?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Brandon,

   I don't deal with Story maps at all so I am not sure the exact code as I don't have an app to reference.

0 Kudos
BrandonPrice
Occasional Contributor

Hi Robert,

No problem.

-Brandon

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Is your storymap public?

0 Kudos
BrandonPrice
Occasional Contributor

Hi Robert,

The customized version is not. The arcgis online version is at this link: https://caltrans.maps.arcgis.com/apps/MapSeries/index.html?appid=9c9b080c67af4d2db74b663efba971bd

I believe it has something to do with putting .setAttribute ("disabled", "") on the BaseMap Toggle. The tab with the Resources is the tab I would like to the BaseMap Toggle removed.

-Brandon

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Brandon,

   I guess that does not help then as there is no basemap toggle in the public version. So basically you need to get the toggle dom node using it's id and then use dojo/dom-style to set the display to none.

0 Kudos