Referencing CDN for ArcGIS API for JavaScript

1337
5
Jump to solution
03-04-2019 11:33 PM
by Anonymous User
Not applicable

I have looked high and low for some no-brainer explanation as to how to do this but to no avail and I'm *very* frustrated. When you say that setting up/getting ArcGIS API for JavaScript is the easiest when referencing the their CDN using this script:

<link rel="stylesheet" href="https://js.arcgis.com/4.10/esri/css/main.css"> <script src="https://js.arcgis.com/4.10/"></script>

What are the step-by-step slow that ensues? I mean, even the introduction seminars that go way back in 2014 does not explain how this happens. Is this question too simple or does everyone seem to know how to do this by default? Do I have to open the Chrome browser source code to do this? What am I supposed to do exactly? 

My main objective is to have cross-hatched style made available or to implement it onto my features that I've published into ArcGIS Online enterprise account. AGOL seems to never want to inherit the any of those 'in-house' customization that I did in ArcGIS Pro.

Below is how it looks like in ArcGIS Pro:

Cross-hatched style for polygons

This is how it looks like after being published into AGOL!:

 

All the hatched symbol I've generated by layering diagonal lines for the style is gone. Almost all. 

      

I found out that one of the way to go about it is to use ArcGIS API for JavaScript or I have to mess with the REST API; both to which...are news to me. I can't even modify the hatched style that came through! I am not against learning new things, but noobs need to start somewhere and I'm not getting anywhere near the starting line after 3 days of no sleep. 

Can someone explain to me how so I can finally get that cross-hatched style in and help a poor soul find some peace finally? I am desperately cornered. 

0 Kudos
1 Solution
5 Replies
RobertScheitlin__GISP
MVP Emeritus

Azalea,

   Well let me tell you right off you can not get what you are wanting to do with the JS API 3.x (which is what is used in WAB and many other template apps). The issue is the JS API 3.x does not allow you to apply color to the cross hatching of a simple fill symbol.

Setting of the hatch color of a simple fill symbol can be done in the JS API 4.x. But that would require you to build your own custom app using the JS API 4.x. So simply put you should not spend any more time on this, you will need to change your maps symbology to not use cross-hatch.

0 Kudos
by Anonymous User
Not applicable

Thanks, Robert. I knew about this prior (ArcGIS API JS 4.x that can implement cross-hatched style and not 3.x) and kicked myself about overlooking the fact that it was for Web Apps. But going back to the question though...how do I get the API and start to work with it? I'm curious on how to start working on it.

0 Kudos
by Anonymous User
Not applicable

Aha!! Thanks Robert! Got exactly what I need after going through the many resources!

Thanks again! I owe you one!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Sure thing. 

Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.

0 Kudos