WebGL Invalid Resource Error

6841
6
Jump to solution
07-31-2018 08:37 AM
DanFrey
New Contributor II

Pesky error, that I'm having a hard time getting past. I'm using the JavaScript API 4.8 to create a 2D web map with some relatively simple layers, and hopefully simple labels. For labeling in particular, I apparently need to enable WebGL rendering of my layers. With a simple renderer, my layers draw fine. As soon as I add the requisite WebGL-enabling section though, in the proper location in my header, rendering fails:

<script>
   var dojoConfig = {
      has: {
         "esri-featurelayer-webgl": 1
      }
   };
</script>

If I look at my console in Chrome, I get:

dojo.js:251 [esri.views.2d.engine.webgl.TextureManager]
  1. {name: "mapview-invalid-resource", message: "Couldn't find font tahoma-bold. Falling back to Arial Unicode MS Regular", details: undefined}
    1. details:undefined
    2. message:"Couldn't find font tahoma-bold. Falling back to Arial Unicode MS Regular"
    3. name:"mapview-invalid-resource"
    4. __proto__:b

The WebGL samples work fine, and do not give this error. 

 

Might anyone have an insight?

Thanks in advance. 

0 Kudos
1 Solution

Accepted Solutions
DanFrey
New Contributor II

Thank you, Rene. I think you've got me headed down the right path. I followed that link and now have a better understanding of supported fonts for what I'm trying to achieve. What was still confusing to me though was that I could find no reference to Tahoma in my label class or anywhere on the page for that matter. I could completely comment out my label class and all references to labeling, and still get the error. Then the light bulb... I was able to confirm a reference to Tahoma Bold in my service definition. This traces back to label setup in ArcPro. So, my next task is to address that, and surely/hopefully that will solve the problem. - thanks again

View solution in original post

6 Replies
ReneRubalcava
Frequent Contributor

It doesn't look like tahoma is currently a supported font family.

Labeling | ArcGIS API for JavaScript 4.8 

Can you try with one of the fonts on that list and see if that works, thanks!

DanFrey
New Contributor II

Thank you, Rene. I think you've got me headed down the right path. I followed that link and now have a better understanding of supported fonts for what I'm trying to achieve. What was still confusing to me though was that I could find no reference to Tahoma in my label class or anywhere on the page for that matter. I could completely comment out my label class and all references to labeling, and still get the error. Then the light bulb... I was able to confirm a reference to Tahoma Bold in my service definition. This traces back to label setup in ArcPro. So, my next task is to address that, and surely/hopefully that will solve the problem. - thanks again

Arne_Gelfert
Occasional Contributor III

Hey Dan, what solution did you come up with for this? I'm getting the similar and innocuous seeming error:

It doesn't seem to "hurt" anything since it falls back to another font. But I figured there is probably a way to override the font spec from the map services (which, as you said is generated in Pro) with some JSAPI for text labels.

DanFrey
New Contributor II

My services are relatively simple, and I control them, so I went back into Pro, changed all of my label fonts to get rid of tahoma, and re-published the services.

0 Kudos
Arne_Gelfert
Occasional Contributor III

Thanks, Dan. I haven't dug too deep into which fonts are "allowed", nor did I create the original maps behind the map services. I'm a little surprised that seemingly common fonts like "Arial something" wouldn't be available. But I'll see what I can learn. Thanks for chiming in.

0 Kudos
Noah-Sager
Esri Regular Contributor

Here is the official list of which fonts are already hosted by Esri and can be used immediately:

https://developers.arcgis.com/javascript/latest/guide/labeling/#fonts-for-featurelayer%2C-csvlayer%2...

The code snippets are really helpful to make sure you are calling the font resource by the appropriate name.