Hexagon Geospatial
MENU

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 
Reply
Contributor
Posts: 37
Registered: ‎02-19-2019
Accepted Solution

Multiple Polygons will be selected on point click

[ Edited ]

Dear Community,

 

I have multiple polygons with same ID (associatied wtih point ID)  on M.App Enterprise Desktop application. I want to select all polygons when click on point.  Please see the image below. I click on point and 2 polygons will be differen color that user can understand that 2 polygons are associated with this point. 

 

multiple polygon.png

 

Thanks in advance !

Staff
Posts: 607
Registered: ‎11-12-2015

Re: Multiple Polygons will be selected on point click

This is not possible out of the box using the provided select tools.

 

Solution to this problem is being explored in existing support ticket.

via Javascript function, SQL query and use of SESSION variables.

 

 

Regular Visitor
Posts: 1
Registered: ‎03-05-2019

Re: Multiple Polygons will be selected on point click

[ Edited ]

    

Highlighted
Contributor
Posts: 37
Registered: ‎02-19-2019

Re: Multiple Polygons will be selected on point click

 

Hi , I have resolved this issue another way. When clicking on point , showing a list with assiciated polygons. On the list there have a Action button . Under this botton action I wrote below code to catch the all polygons ID.

 

var currentItems = [];  _.each(IG.list.widget.dataSource.data(), function(item){currentItems.push(item[IG.listSettings.idfield]);}); SelectElements('PlanningPoint',currentItems)

This is my Javascript function to catch the Polygon IDs and selecting all Polygons (making different color that user can understand that polygons are associated with this point)

SelectElements=function (layername,featureids){ 



  SC.Map.setActiveLayer(layername).then(function(){

      return SC.Map.clearSelectedElements().then(function(){         

            return SC.Map.setSelectedElements(featureids).then(function(){ 

                 SC.Map.closeWebBrowser();                           

          });

      });

  }).fail(function (error) {

          alert(error);

  });

}

Happy coding !

 

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.