Creating mouseOver and onClick events in embedded map

1300
1
Jump to solution
02-11-2021 10:00 AM
DaphneShaed
New Contributor

Hello,

I am very new to ArcGIS. I have a web page that contains an embedded map of an area that contains several regions. I would like to create onmouseover and onclick events for the regions on the map. 

onmouseover: region polygon becomes visible.

onclick: a new tab opens linked to an information page and gallery of the region. 

I have worked with SVG on other sites where the path is wrapped in an anchor tag and CSS controls path colour. Example:

CSS: .region-svg:hover { fill: #003366; }

HTML: 

<a href="www.somepage.com">

<svg width="400" height="110">

<rect class="region-svg" width="300" height="100" style="fill:#006600;stroke-width:3;stroke:rgb(0,0,0)" />

</svg>

</a> 

 

So how to attain a similar effect with an embedded ArcGIS map? The map is served from a portal and I can edit all sort of attributes, and popups, but I do not want the popup, I want it to highlight the region on mouse over, and on click go to a specific url for each region. Is there a way to do this with ArcGIS?

 

Thank you. 

 

 

 

 

 

 

 

 

 

 

 

0 Kudos
1 Solution

Accepted Solutions
BlakeTerhune
MVP Regular Contributor

Check out the hitTest() method of MapView. I think you can use it to do what you need. Here's a sample app with pointer-move event.

View solution in original post

1 Reply
BlakeTerhune
MVP Regular Contributor

Check out the hitTest() method of MapView. I think you can use it to do what you need. Here's a sample app with pointer-move event.