public void onMouseUp ( MouseUpEvent event ) { // Do not interfere with default behaviour: super . onMouseUp ( event ) ; // Get the event location in world space: Coordinate worldLocation = getLocation ( event , RenderSpace . WORLD ) ; // Now execute the GetFeatureInfo for each layer: for ( FeatureInfoSupported layer : layers ) { GetFeatureInfoFormat f = GetFeatureInfoFormat . fromFormat ( format ) ; if ( f != null ) { switch ( f ) { case GML2 : case GML3 : case JSON : if ( featureCallback == null ) { throw new IllegalStateException ( "No callback has been set on the WmsGetFeatureInfoController" ) ; } layer . getFeatureInfo ( worldLocation , format , featureCallback ) ; break ; case HTML : case TEXT : default : if ( htmlCallback == null ) { throw new IllegalStateException ( "No callback has been set on the WmsGetFeatureInfoController" ) ; } htmlCallback . onSuccess ( layer . getFeatureInfoUrl ( worldLocation , format ) ) ; break ; } } } }
Execute a GetFeatureInfo on mouse up .