The filled shape and the canvas layer are two different layers with their own events. When you click on the filled shape to drag the map, the click event of the shape is fired because the map does not know whether the user intends to click the shape or pan the map. If we prevent the OnShapeClick event, this is going to bean unwanted breaking change.
What you can do in your scenario is to use the OnPan (fired while the map viewport is being moved) and OnPanEnd (fires after the map viewport has been moved) client events to check whether the map is being moved and if it is not to allow the OnShapeClick event, otherwise to cancel it.
Since the OnShapeClick is fired after OnPan execution, you can:
- Create a global variable (flag) in which you store the coordinate of the map center, or of a shape or another position identifier
- Check the coordinates in the OnPan event and if they are different from the ones stored in the flag variable cancel the OnShapeClick event (with return false). If the coordinates of the position identifier are the not changed (the map is not moved) then do not alter the execution of the OnShapeClick event and show the dialog.