GMSC Discussions

GeoMedia Smart Client community discussion board is where you can create, contribute and share information and knowledge in regards to configuring as well as working with GeoMedia Smart Client. Find your answers, share your knowledge and help build a strong GeoMedia Smart Client community.
Showing results for 
Search instead for 
Do you mean 
Reply
Occasional Contributor
Posts: 8
Registered: ‎05-05-2019

javascript debuging

geomedia smart client how i can debug javascript code or is there any way to check javascript error

Staff
Posts: 1,051
Registered: ‎10-18-2015

Re: javascript debuging

in the latest releases og GMSC there is an integrated Firebug lite within the Java browser (you can open it by pressing F12). It is not as powerful as a standard developer tool provided by browsers like Chrome or FF. If you want to use those browsers you can also open the workflow outside of the Java context and debug it there (you find the URL to open it in the client log file). In this case you will not have the possibility to get access to the scripting object that communicates with the map.

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Occasional Contributor
Posts: 8
Registered: ‎05-05-2019

Re: javascript debuging

thanks for your reply Dear i am using GMSC 16.5.240.3 so when i press F12 there nothing happend can you explain little more how i can open it in chrome where i can find the url ?thanks in advance 

Staff
Posts: 1,051
Registered: ‎10-18-2015

Re: javascript debuging

the client log file is accessible from status bar on the bottom of your window. please check here:

https://community.hexagongeospatial.com/t5/GMSC-Tutorials/Log-Files/ta-p/259

https://hexagongeospatial.fluidtopics.net/reader/KhC_gJxQm2W1vTsJtffMKg/H2gKHlKvUQU~dInp~ECqyg

 

you must set the log details to all and then open the workflow, in the log file you will then find the full URL to open it.

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Occasional Contributor
Posts: 8
Registered: ‎05-05-2019

Re: javascript debuging

thanks again

After selecting All Option i got the log file with lot of detail logs i also attached my log file with this can you explain after looking into my log file where is my URL

thank you dear your answers helping alot

Occasional Contributor
Posts: 8
Registered: ‎05-05-2019

Re: javascript debuging

[ Edited ]

hello again

 

ok i found the url and open it into the browser but problem is still there i need the map object how i can get map object into the browser or can you guide how i can overlay an external image on map using javascript.

thanks

 

Staff
Posts: 1,051
Registered: ‎10-18-2015

Re: javascript debuging

as said there is no way to get the map object outside of the Java context. In general to debug the JS methods that communicate with the map is not hard, it is enough to put some notifications in your code to understand at what point the script fails. you can 

looks stange to me you cannot open the Java browser console, you can try to put firebug lite at the beginning of a custom script :

 

 

$("head").append('<script type="text/javascript" src="https://getfirebug.com/firebug-lite.js"></script>');

In there you can call the SC.Map methods individually.

 

I'm not quite sure what you mean by "how I can overlay an external image on map".

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Occasional Contributor
Posts: 8
Registered: ‎05-05-2019

Re: javascript debuging

HI

thanks for previous help i got the fire bug plugin on my side.

Now actually i need a SC.Map.addLayer(my layer object) so i can add my layer to map on client side directly just to view but so far i didn't found any addLayer function with SC.Map please help thanks;

Staff
Posts: 1,051
Registered: ‎10-18-2015

Re: javascript debuging

there is not an addLayer method. The API is published here:

https://community.hexagongeospatial.com/t5/GMSC-Tutorials/Javascript-API/ta-p/25119

 

you would need a custom plugin to do this.

 

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Occasional Contributor
Posts: 8
Registered: ‎05-05-2019

Re: javascript debuging

hi stefano

 

i have a layer object i want to add it into map i see no function in above documentation to add that into map.All available function take layer name as string then thses function can make already added layer visible ,hide etc ......  but i want to add new layer on fly no metters it add into legend or not how i can do that thanks in advance 

thanks