Hexagon Geospatial

M.App Enterprise

Discuss topics with other M.App Enterprise Product pioneers and experts to get the most out of it.
Showing results for 
Search instead for 
Do you mean 
Frequent Contributor
Posts: 159
Registered: ‎01-14-2018
Accepted Solution

M.App Enterprise zoom row action not working correctly

Dear all,


In building a list in M.App Enterprise, I am using a row action that should zoom into the point layer named (Giza) using the following javascript:

SC.Map.setActiveLayer('Giza'); SC.Map.setSelectedElements({ROW.gid});SC.Map.setMapScale(16000); SC.Map.fitSelectedElements(); SC.Map.closeWebBrowser()

But when I click on that action button it doesn't zoom into the desired point.


Could you please help with that.


Best Regards,



Posts: 1,036
Registered: ‎10-18-2015

Re: M.App Enterprise zoom row action not working correctly

Hi Khaled,


please have a look at the following tutorial (Javascript API is asynchronous, so you have to wait for the execution of the previous method):






Stefano Turcato
Presale Engineer
Hexagon Geospatial
Frequent Contributor
Posts: 114
Registered: ‎05-25-2016

Re: M.App Enterprise zoom row action not working correctly

In case someone is not getting it, the key is in the " someting.then(function(){}". 

if you write your code like 


SC.Map.setActiveLayer('Giza'); SC.Map.setSelectedElements({ROW.gid});


Then javascript API will try ti execute "SC.Map.setSelectedElements()" at the same time than the "SC.Map.setActiveLaye" part and since the active layer is not set you´ll get an error.

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Development Ticket through our Development Ticket Portal.