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

Add FeatureInfo Button to Consumer Portal

Hi,

 

is there an example how to add a new Button with "get featureInfo" to the ConsumerPortal?

(adding a Button is not the Problem, the "$GP.map.info" function in GeoSpatial Portal for ConsumerPortal is what I need)

 

kind regards

Technical Evangelist
Posts: 804
Registered: ‎09-11-2015

Re: Add FeatureInfo Button to Consumer Portal

[ Edited ]

Hi Reinhard,

 

firstly please see this discussion on how to get the Leaflet map handle. The sample mentioned there also contains a code for adding some button to the UI which might be useful for your case too.

http://community.hexagongeospatial.com/t5/Developer-Discussions/Learning-consumer-portal-and-its-SDK...

 

Then you simply add event for everriding the "on" event once. This sample directly creates such single event.

mainContext.switchingMapAdapter.getMapAdapter().then(function (adapter) {
   var swipeActive = false,
   map = adapter.__map

   function getCoords(e) {
      alert("Lat, Lon : " + e.latlng.lat + ", " + e.latlng.lng)
      map.off("click", reset);
   }

   map.on("click", getCoords);
});

Regards,

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Contributor
Posts: 28
Registered: ‎04-20-2016

Re: Add FeatureInfo Button to Consumer Portal

Hi,

 

this works but how to show the objekt info from a wfs feature on the map like the featureInfo Button in the Geospatial Portal?

 

regards

Reinhard

Technical Evangelist
Posts: 804
Registered: ‎09-11-2015

Re: Add FeatureInfo Button to Consumer Portal

Hi Richard,

 

Do you mean how to display the attribute window with results? You can use ExtJS v4 framework that is delivered with Consumer Portal. Please check the examples-ext.js file, there's a simple floating window example. This window can render any HTML content:

  • Either do it maunally by converting the GetFeatureInfo response from a web service to appropriate HTML table
  • Or use other ExtJS Grid controls such as ArrayGrid which can render the arrays by supplying proper JSON data

 Untitled.png

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Contributor
Posts: 28
Registered: ‎04-20-2016

Re: Add FeatureInfo Button to Consumer Portal

H

Contributor
Posts: 28
Registered: ‎04-20-2016

Re: Add FeatureInfo Button to Consumer Portal

Hi,

 

no... I mean i like to klick on the map (in the consumer portal) and get the Information from the wms feature at this point.

Like in the ObjektInfo in the Geospatial Portal. ObjektInfo.png

(And then the Attributes could be representet in a grid panel or in any other way)

 

Klick on the Info Icon, change the Cursor, klick in the map (on a wms feature) and get the attributes in a new window, as popup or something like this.

 

Regards

Reinhard

Technical Evangelist
Posts: 804
Registered: ‎09-11-2015

Re: Add FeatureInfo Button to Consumer Portal

Hi Reinhard,

 

To add button use the sample:

$GP.ui.toolbar.add({
    id: "featureInfoButton",
    title: "Get Feature Info"
}, function (ret){
    // change mouse pointer, enable map click as shown above
});

To change mouse pointer, e.g.:

https://stackoverflow.com/questions/4564251/change-the-mouse-pointer-using-javascript

 

Then you should iterate over legend entries and call feature info on each service. Unfortunately the $GP.legend.find() does not return service URLs. I will double check with our development if it's possible to get this information somehow.

 

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Technical Evangelist
Posts: 804
Registered: ‎09-11-2015

Re: Add FeatureInfo Button to Consumer Portal

By the way, the Feature Info functionallity will be a part of next major release...

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Contributor
Posts: 28
Registered: ‎04-20-2016

Re: Add FeatureInfo Button to Consumer Portal

Ah ok, is there a date when the next major release is rtm?

 

Maybe there is until then a way to get it to work in the 2016 Consumer Portal?

 

Regards

Reinhard

Technical Evangelist
Posts: 804
Registered: ‎09-11-2015

Re: Add FeatureInfo Button to Consumer Portal

I think the release is planned to end of 2017 / beginning of 2018. There are no plans to have this feature back in 2016, so the only way is to implement it by your own.

 

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

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