Select to view content in your preferred language

Creating a right-click Context Menu for Layers in Java Runtime

1126
1
08-25-2017 04:19 AM
NateSwan
New Contributor

Anyone have an idea for how I'd create a basic context menu when right clicking on a map?

Let's say I just want to right click my basemap to display different types of graphics available to me.

This is similar to what I want, only in Javascript...

Context Menu for Map and Graphics 

0 Kudos
1 Reply
JackFairfield
Frequent Contributor

Use the click event on the mapview.

view.on("click", (e) => {
   if(e.button === 2){

      console.log("right click happened");

 }
})

0 Kudos