03-10-2020 07:35 AM
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
03-11-2020 04:18 AM
Hi Jacques,
Does this happen for any legend entry? Both SDK-based or native ones?
03-11-2020 04:21 AM
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
03-12-2020 05:08 AM
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)
03-12-2020 07:32 AM
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?
03-13-2020 12:59 AM
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
03-13-2020 01:27 AM
Can you reproduce the issue on another GPW? E.g. the default one + one WMPS layer added.