Graphics in a graphics layer only appear on zoom

2095
7
Jump to solution
03-17-2021 01:29 AM
DaveAdams
New Contributor III

Hi all,

I'm creating an app with 4.18 and have found that graphics, added to a graphics layer in the map, only appear after I manually zoom in on first creation. They are present in the layer if I log it to the console but not visible. If I zoom in, then they draw. I have tried changing the view extent after the creation but that does not refresh the graphics

I am creating the empty graphics layer when the map and mapview are first created and then adding graphics in subsequent processes. I need the graphics to be visible to the user when when they enter the application.

Any suggestions would be greatly appreciated.

Tags (1)
1 Solution

Accepted Solutions
AndyGup
Esri Regular Contributor

That bug has been fixed for 4.19 which is releasing in early April. You can verify this by testing your app using the "next" build: https://github.com/Esri/feedback-js-api-next

View solution in original post

7 Replies
AndyGup
Esri Regular Contributor

That bug has been fixed for 4.19 which is releasing in early April. You can verify this by testing your app using the "next" build: https://github.com/Esri/feedback-js-api-next

DaveAdams
New Contributor III

Many thanks Andy for the prompt reply,

we are coding using the ES modules in angular - will that bug fix also apply?

0 Kudos
AndyGup
Esri Regular Contributor

@DaveAdams  definitely, you can try it out by running: npm i @arcgis/core@next 

0 Kudos
DaveAdams
New Contributor III

Hi Andy, I know the fix is imminent but just wondered if you knew of any trick around this in the short-term? I have tried programmatically zooming the map afterwards and changing the visibility of the graphicslayer to see if those actions caused a refresh without a manual zoom requirement.

0 Kudos
AndyGup
Esri Regular Contributor

You might take a look at these issue comments for potential workaround: https://github.com/Esri/jsapi-resources/issues/268#issuecomment-781899119. I didn't test them out, so I can't vouch for them.

0 Kudos
DaveAdams
New Contributor III

Many thanks Andy, I'll give it a try and post back the results (I like the name of the function)

0 Kudos
DaveAdams
New Contributor III

Thank you - the workaround worked for me but I look forward to the imminent bug fix

0 Kudos