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
Contributor
Posts: 29
Registered: ‎10-12-2015

Show GPS coordinates in Workflow Form

Hi

 

I need to capture GPS coordinates in a workflow form for which I am currently using the Microsoft Location API. By referring to the GMSC Java Api which says,

 

The GPSScriptingObject is populated as a JavaScript object to the internal web browser and offers methods to communicate with the attached GPSDevice.

Developers creating their own HTML and JavaScript pages can access this object directly form the DOM structure calling window.GPS.

Sample 1: Get the gps coordinate of the position.

 function getCoordinateFromGPS()
 {
        var gpsCoordinate = window.GPS.getPosition().getGpsCoordinate();
        alert(gpsCoordinate.getLat() + " " + gpsCoordinate.getLon());
 }
 

Sample 2: Get the coordinate of the position in the project coordinate system.

 function getCoordinateFromGPS()
 {
        var coordinate = window.GPS.getPosition().getCoordinate();
        alert(coordinate.getX() + " " + coordinate.getY());
 } 

 

When I call the function, the GPS automatically gets started and I could see the response in the GPS panel in GMSC. But it does not show the coordinate information in alert message as given in above documented examples.

 

Please suggest how can I make this work.

 

Thank you

 

Rohit Sinha

Hexagon Geospatial, India

Rohit Sinha
Hexagon Geospatial
Staff
Posts: 1,032
Registered: ‎10-18-2015

Re: Show GPS coordinates in Workflow Form

Hi,

 

did you try with IG.notify instead of alert? It does not interfere with Javascript executions...

Could you also try to fill a formfield with those values?

 

Regards,

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Highlighted
Contributor
Posts: 29
Registered: ‎10-12-2015

Re: Show GPS coordinates in Workflow Form

Hi,

 

I tried with IG.notify and fill the FormFields values, but still no luck.With IG.notify the notification does not even pop up, and the formFields are blank.

 

No idea why it is not giving results coz I am able to get the handle using alert('window.GPS') as "com.intergraph.web.plugin.webbrowser.handler.SynchronousGPSScriptingObject@572dcc".

 

Regards

Rohit Sinha

 

Rohit Sinha
Hexagon Geospatial
Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.