Hello,
How can I combine a simplemarkersymbol and textsymbol?
I have the following code in js, but that shows one or the other:
var pointGraphicA = new Graphic({
geometry: point,
symbol: simpleMarkerSymbol,
attributes: attributes,
popupTemplate: popupTemplate,
symbol: textSymbol
});
Kind regards,
Baran
Baran,
A graphic can only have one symbol period. So to get a TextSymbol in the same location you have to add another graphic with the TextSymbol. The is no concept of a compositeSymbol like there was in other esri libraries.
While Robert Scheitlin, GISP is right that we don't yet have a stable way of handling composite symbology in the JSAPI yet, we do have beta CIM support which I think should allow you to achieve what you are looking for. You could also go the FeatureColletion + label route if you want deconfliction (adding support for an option to disable label deconfliction is in the works).
I would take a look at CIMSymbol | ArcGIS API for JavaScript 4.14