The map allows you to retrieve the objects that are visualized at a particular location.
pickAt(x,y,radius) instance method of the
Map to retrieve all objects at the screen position specified by the
Only objects in selectable layers are considered for selection.
Alternatively, use the
pickClosestObject(x,y,radius) instance method to retrieve the first selectable object near the screen position specified by the
Two other methods,
pickClosestObjectRectangle, retrieve objects that are visualized in a specific rectangular area.
You specify the rectangle by defining the position of its center point and its width and height.
By default, all of those methods check if the view position overlaps with the visualized shape of the feature.
If you also want to retrieve objects if the view position overlaps with the labels of the feature, you need to use the optional
It indicates what paint representation is used to retrieve features:
The feature body is used to retrieve an object:
The feature label is used to retrieve an object:
If you omit this parameter, only the feature bodies are used to retrieve the object.