1

I'm interested in programmatically finding out information of the features (of a map) under the mouse. I'm using GeoTools for drawing the map using a shapefile. I've first used the following code line by overriding onReportedUpdated().

InfoTool tool = new InfoTool() {
        @Override
        public void onReporterUpdated() {
            String text = getTextReporterConnection().getText();
            System.out.println(text);
        }
    };

But, here I get a full string with all information. Yet, I would like to individually find those feature information.

I've found this question, in which it is said that there's no direct API call for this. But since this is a quite old question, I would like to know whether there's any direct API methods to achieve this.

0

1 Answer 1

1

I've followed selection lab of geotools. Source here. It would be an answer for this question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.