Disable Map Panning for an event

876
2
Jump to solution
10-24-2017 10:22 AM
NicholasLiccini
New Contributor II

Hi!

I would like to have the ability to control whether you can pan the map from the map view based on certain signals. How would I be able to toggle whether the user can pan the map using the same settings that ArcGIS provides?

Thanks!

Nick

0 Kudos
1 Solution

Accepted Solutions
LucasDanzinger
Esri Frequent Contributor

You will need to "accept" the mouse signals so they don't go through, and that should stop the default behavior from happening

connect(m_mapView, &MapGraphicsView::mousePressed, this, [this](QMouseEvent& event)
{
  event.accept();
});

View solution in original post

2 Replies
LucasDanzinger
Esri Frequent Contributor

You will need to "accept" the mouse signals so they don't go through, and that should stop the default behavior from happening

connect(m_mapView, &MapGraphicsView::mousePressed, this, [this](QMouseEvent& event)
{
  event.accept();
});
NicholasLiccini
New Contributor II

This worked! Thank you

0 Kudos