WebGIS Discussions

Need a push in the right direction when configuring WebMap, Portal or SDI services? Looking for hints and tips, or just looking for Ideas and information? The WebGIS discussion board is where you start those discussions, connect and share information.
Showing results for 
Search instead for 
Do you mean 
Reply
Regular Contributor
Posts: 234
Registered: ‎07-27-2016

Geospatial Portal LegendItem Priority

Hi Guys,

 

Any suggestions would be appreciated.

I am simply trying to move a legend entry to the topmost position.

 

$GP.legend.find({
name: "Cultivated Areas"
}, function(result) {
result.legendItems[1].set_priority(0);
});

 

I get the following Error,The legend entry is found , and I can return the current priority, any ideas?

 

Error: Cannot find a map layer definition for the legend item '144'

 

After the message all map content is removed and the legend stays unchanged.

 

Developer console:

 

_findMapLayerDefinition: function(legendItemId)
{
if (this._mapLayerDefinitionsByKey[legendItemId])
return this._mapLayerDefinitionsByKey[legendItemId];
else
throw new Error(String.format(this._translate.E_MapLayerDefinitionNotFound_Format, legendItemId));
},

 

Kind Regards

Jacques

Technical Evangelist
Posts: 1,424
Registered: ‎09-11-2015

Re: Geospatial Portal LegendItem Priority

Hi Jacques,

 

Does this happen for any legend entry? Both SDK-based or native ones?

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Regular Contributor
Posts: 234
Registered: ‎07-27-2016

Re: Geospatial Portal LegendItem Priority

Hi Jan,

 

I have not tested this yet on a native one.

I will do the test and let you know.

 

Thanks!

 

Kind Regards

Jacques

Regular Contributor
Posts: 234
Registered: ‎07-27-2016

Re: Geospatial Portal LegendItem Priority

Hi Jan,

 

It seems to be the same result SDK based and Native for any legend entry priority.

 

Compositor.WebClient.ashx?p=%2fGeoFarmSAProfessional%2fApolloPro.aspx&e=en-GB.release.js&t=637097723286576512:939 Uncaught Error: Cannot find a map layer definition for the legend item '144'
at Intergraph.WebSolutions.Core.WebClient.Platform.MapContent.MapState._findMapLayerDefinition (Compositor.WebClient.ashx?p=%2fGeoFarmSAProfessional%2fApolloPro.aspx&e=en-GB.release.js&t=637097723286576512:939)
at Intergraph.WebSolutions.Core.WebClient.Platform.MapContent.MapState._getPendingMapLayerConfigs (Compositor.WebClient.ashx?p=%2fGeoFarmSAProfessional%2fApolloPro.aspx&e=en-GB.release.js&t=637097723286576512:939)
at Intergraph.WebSolutions.Core.WebClient.Platform.MapContent.MapState._createMapLayerConfigs (Compositor.WebClient.ashx?p=%2fGeoFarmSAProfessional%2fApolloPro.aspx&e=en-GB.release.js&t=637097723286576512:939)
at Intergraph.WebSolutions.Core.WebClient.Platform.MapContent.MapState._ensureMapContent (Compositor.WebClient.ashx?p=%2fGeoFarmSAProfessional%2fApolloPro.aspx&e=en-GB.release.js&t=637097723286576512:939)
at Intergraph.WebSolutions.Core.WebClient.Platform.MapContent.MapState.createMapLayers (Compositor.WebClient.ashx?p=%2fGeoFarmSAProfessional%2fApolloPro.aspx&e=en-GB.release.js&t=637097723286576512:939)
at Intergraph.WebSolutions.Core.WebClient.Controls.Map.MapControl._resetLayers (Compositor.WebClient.ashx?p=%2fGeoFarmSAProfessional%2fApolloPro.aspx&e=en-GB.release.js&t=637097723286576512:2004)
at Intergraph.WebSolutions.Core.WebClient.Controls.Map.MapControl.priorityChanged (Compositor.WebClient.ashx?p=%2fGeoFarmSAProfessional%2fApolloPro.aspx&e=en-GB.release.js&t=637097723286576512:2004)
at Intergraph.WebSolutions.Core.WebClient.Controls.Map.MapControlContainer._priorityChanged (Compositor.WebClient.ashx?p=%2fGeoFarmSAProfessional%2fApolloPro.aspx&e=en-GB.release.js&t=637097723286576512:2210)
at Intergraph.WebSolutions.Core.WebClient.Platform.ClientScript._ClientEventManager.notify (Compositor.WebClient.ashx?p=%2fGeoFarmSAProfessional%2fApolloPro.aspx&e=en-GB.release.js&t=637097723286576512:889)
at Ia.set_priority (Compositor.WebClient.ashx?p=%2fGeoFarmSAProfessional%2fApolloPro.aspx&e=en-GB.release.js&t=637097723286576512:531)

Technical Evangelist
Posts: 1,424
Registered: ‎09-11-2015

Re: Geospatial Portal LegendItem Priority

I have tried the code here with one of the sample WMS connected and it worked fine - the WMS layer order did change depending on the priority number.

http://demo.hexagongeospatial.com/communityportal/

 

However that site has some of the older 16.5 builds.

 

Can you perhaps provide more details of your setup?

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Regular Contributor
Posts: 234
Registered: ‎07-27-2016

Re: Geospatial Portal LegendItem Priority

Hi Jan,

 

Thanks for the reply.

I have tested it on the demo portal supplied, the code seems fine.

 

I am running 16.5 EP02 SDK also OEM , get the same result.

The legends are not register via the api , it is wmps layers added with the data sources tools and saved as normal procedure.

 

I just want to move one of the legend entries to the topmost posistion if oe of the tools are used but keep getting the below error when setting the priority:

 

Error: Cannot find a map layer definition for the legend item '144'

 

Regards

Jacques

Technical Evangelist
Posts: 1,424
Registered: ‎09-11-2015

Re: Geospatial Portal LegendItem Priority

Can you reproduce the issue on another GPW? E.g. the default one + one WMPS layer added.

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial