Hi All,
i am creating a custom widget that utilises a feature layer created either from a feature collection or a URL to an existing published feature service (I have tried both methods). I want to label the features but I have tried every possibility going with no luck.
if I create a sample HTML page using the 3.18 JS library out side of WAB I can get the labels to appear. I think the issue is setting the map.showLabels to true within the widget.
To experiment a little further I have tried turning the map attribution off within the widget using map.showAttribution = false but this does not work either. I see there is no getter or setter methods for changing these attributes to the map object.
has anyone else managed to get labels to work on a feature layer within a WAB widget? Or is this a limitation of WAB?
Regards
Anthony
Solved! Go to Solution.
Anthony,
Yes that is a big draw back. I have run into other things that I have wanted/needed to change in the jimu.js core for a widget and I have considered building an installer app that will do the changes to the core files and add my widget. That is one route.
Anthony,
I have the same problem as you. I need to create a Feature Layer from FeatureCollection. My layer is a point FL. And I need to show labels on this layer. I have read this thread, add mapOptions.showLabels = true to the jimu.js/MapManager.js as Robert recomanded, add showLabels": true to the config.json as you recomanded but no labels are shown.
I tested FL made from url and it works but FL from FeatureCollection doesn't.
Do you have any suggestions what else should I do?
Thank you for help
Regards
Zdenek
Did you find the solution for this? I have the same issue!
I have the same problem. I can't see the labels.
I create a layer with FeatureLayer. I don't know where I should deactivate the label.
I added it indicates it but still it does not activate the label
Seguí todos los pasos que indica Robert y Anthony. El detalle de mío que la asignación del valor demora unos segundos. Agregue un SETTIMEOUT y con ello se soluciona el problema.
Resultado final
Capa creada dinamicamente para su posterior carga dinamicamente.