How to change or remove selection colour in 4.15?

396
3
Jump to solution
05-15-2020 04:32 AM
ChristianBischof
Esri Contributor

I have a similar question as it was asked years ago in this thread:

   https://community.esri.com/thread/116957 

Whenever an item is selected on my webmap it gets this default cyan colour. Is there any possible way to disable this functionality?

I am using JS API 4.15

Thanks in advance!

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

This works fine for me:

        var view = new MapView({
container: "viewDiv",
map: map,
center: [-101.94981250000075, 41.20977753557709],
zoom: 5
});

view.popup.highlightEnabled = false;‍‍‍‍‍‍‍‍

View solution in original post

3 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Christian. 

  Have you seen the highlightEnabled property of the views popup?

https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#highlightEnabl... 

ChristianBischof
Esri Contributor

Thanks Robert Scheitlin, GISP‌ but this highlightEnabled property seems not to work for me. Despite that you gave me some inspiration to solve the problem by using the following properties on my mapview.

view = new MapView({
map: webmap,
container: "viewDiv",
highlightOptions: {
   color: [255,255,255,0]
}
});

I've achieved, what I wanted, despite that I'd like to know how you'd have solved this problem with the property you mentioned.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

This works fine for me:

        var view = new MapView({
container: "viewDiv",
map: map,
center: [-101.94981250000075, 41.20977753557709],
zoom: 5
});

view.popup.highlightEnabled = false;‍‍‍‍‍‍‍‍

View solution in original post