Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Frequent Contributor
Posts: 118
Registered: ‎10-13-2015

SELECT FEATURES METHOD: DO NOT ALWAYS SELECT ELEMENTS

Hi Lukasz.

 

We need to selected multiple features of a vector geopackage layer.
We started the app and we zoomin the map until the layer is visible.

 

Case example 1:

 

1. If the feature with id 1890 is visible in the map, the feature is selected correctly and works fine.
2. If the feature with id 1890 is not visible in the map, the feature is not selected and returns an error message

 

 

Error while selecting feature: InvalidArgument: There is no feature(s) matching featureClassId: {offline/bocaRecXE.gpkg}Boca_de_rec_XE_FID and featureId: 1890

 

 

Code of case 1

 

 

var successCallback = function (result) {
    console.log("Feature selected");
};
 
var errorCallback = function (error) {
    console.log("Error while selecting feature: " + error.message);
};
 
var config = {
    featureClassId: "{offline/bocaRecXE.gpkg}Boca_de_rec_XE_FID",
    featureIds: ["1890"]  //id of the existing feature
}

 

Case example 2:

 

1. If the feature with id 1890 and 207 are visible in the map, the features are selected correctly and works fine.
2. if one feature of the list (1890, 207) is visible in the map, the features are selected correctly and works fine.
3. if no feature of the list (1890, 207) is visible in the map, the features are not selected and returns an error message

 

Error while selecting feature: InvalidArgument: There is no feature(s) matching featureClassId: {offline/bocaRecXE.gpkg}Boca_de_rec_XE_FID and featureId: 1890 

Code of case 2:

 

var successCallback = function (result) {
    console.log("Feature selected");
};
 
var errorCallback = function (error) {
    console.log("Error while selecting feature: " + error.message);
};
 
var config = {
    featureClassId: "{offline/bocaRecXE.gpkg}Boca_de_rec_XE_FID",
    featureIds: ["1890", "207"]  //id of the existing feature
}

In all case the layer is visible in the map.

 

Best Regards,

Marti.

Technical Evangelist
Posts: 184
Registered: ‎07-30-2015

Re: SELECT FEATURES METHOD: DO NOT ALWAYS SELECT ELEMENTS

[ Edited ]

Hi,

 

Selection api is constrained to the visible features.

 

Łukasz

Highlighted
Frequent Contributor
Posts: 118
Registered: ‎10-13-2015

Re: SELECT FEATURES METHOD: DO NOT ALWAYS SELECT ELEMENTS

[ Edited ]

Is it possible to configure this behavior?
For us this is a problem because we would like to select multiple features and next apply to zoom to the selected features.
Not always we have the features visible in the view.

In our tests we see that it is not necessary to have all visible features only is necessary that one feature is visible in the view.
Is it a strange behavior? 

Polls
Please register to vote
Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.