How to over-ride the Label layer.js files method?

132
0
05-27-2020 08:00 AM
ShaikhRizuan
New Contributor III

Hi,

I am trying to over-ride few methods of LabelLayer.js file, there are 2 class  "esri/layers/labelLayerUtils/DynamicLabelClass & "esri/layers/labelLayerUtils/StaticLabelClass" which has been called from that js file.

It is working fine for below code:

require(["esri/layers/labelLayerUtils/DynamicLabelClass"],function(dc){
if( typeof esri.layers.labelLayerUtils.DynamicLabelClass.prototype._findPlace == 'function' )
{
esri.layers.labelLayerUtils.DynamicLabelClass.prototype._findPlace = function(h, b, a, c, k, d, e){

When i tried to over-ride method for StaticLabelClass, its throwing "Prototype is undefined"

require(["esri/layers/labelLayerUtils/StaticLabelClass"],function(sc){
if(typeof esri.layers.labelLayerUtils.StaticLabel.prototype._findPlace='function'){

esri.layers.labelLayerUtils.StaticLabel.prototype._findPlace = function(b, a, c, k, d, e, f){

During debug, for labelLayerUtils, only DynamicLabelClass shown. PFB image

whereas in JS API, I can see there are 2 files:

Please help me how to get "StaticLabelClass" method to over-ride?

Regards,

Shaikh

0 Kudos
0 Replies