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
Highlighted
Contributor
Posts: 28
Registered: ‎04-20-2016
Accepted Solution

Clear Query with Button

[ Edited ]

Hi,

 

I`ve tried the SDK Fancy Tooltip example but, how do I remove the added query after adding it?

 

I`ve 2 Buttons with 2 different WFS Queries. 

 

$GP.queries.find({
 analysisId: queryResult.analysisId
 }, function (findAnalysisResult) {
 findAnalysisResult.analysis.getData(function (getDataResult) {
 renderPins(getDataResult.data[0]);
 });

I can remove the pin itselve but the query still remain and I`m not able to add another "Fancy Tooltip" with button 2 to the map.

 

tried with $GP.queries.clear(); but this did not work. They disappear but the pins from query(button)2 are renderd on the same position as the "old" ones.

I`f i reload after each "press one of the 2 buttons" it works for each one.

 

kind regards

R

Technical Evangelist
Posts: 1,118
Registered: ‎09-11-2015

Re: Clear Query with Button

[ Edited ]

Hello Reinhard,

 

There is not a documented function like $GP.queries.clear(). Did you perhaps mean $GP.map.pin.clear()?

 

Anyway, the correct way of removing Queries (Analyses) is something like:

$GP.queries.find({
        analysisId: /* you must remember the last query ID */
}, function (findAnalysisResult) {
        findAnalysisResult.analysis.remove(); // alt. add callback here
    });

Jan

 

 

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Regular Contributor
Posts: 248
Registered: ‎05-01-2016

Re: Clear Query with Button

[ Edited ]

I'm able to remove a query from the map and the legend.  Is there a way to remove its tab from the Data View?

thanks!

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.