javascript configuration for Portal?

3817
6
09-01-2015 09:37 AM
RobertWhite2
New Contributor II

Esri/Viewer · GitHub

I have obtained the Viewer application from GitHub and added a module that supports map navigation by legislative district.  The application works perfectly for ArcGIS Online versions of our maps, but not Portal.  In index.html I have configured references to the JavaScript libraries to point to our server, as instructed in the liner notes, but the application fails for "404" reasons.

<script type="text/javascript" src="//......capitol.local/arcport/jsapi/jsapi"></script>

The JavaScript code is present in the app at run time, so now I have questions about whether I am actually missing something in the libraries.  What is wrong with this picture?  I do explicitly add a reference to color.js in the code I added, but haven't done anything with "oAuthInfo."

Capture.PNG

Tags (2)
0 Kudos
6 Replies
BjornSvensson
Esri Regular Contributor

Robert White
Does it work when if you point it to the CDN hosted JSAPI?

What version of Portal are you using?  (It might be a version using an older version of the JSAPI...)

0 Kudos
RobinWhite
New Contributor III

All the apps we've done so far implement the CDN--this one is exceptional in that we're working with Portal instead of ArcGIS Online.  I will follow your suggestion and find out what version we have, and whether we should replace the library with version 3.14.

thanks

-r.w.

0 Kudos
BjornSvensson
Esri Regular Contributor

Just FYI:

Portal 10.3 shipped with JSAPI 3.11.

Portal 10.3.1 shipped with JSAPI 3.13.

If you're using some features that are specific to 3.14, you would need to use the CDN or host it.

0 Kudos
RobertWhite2
New Contributor II

We're at 10.2.2, I think. Our IT support has an iterative backlog and it will be several months before they'll upgrade to a newer release. The sooner the better!

Thanks

--robert

sent from mobile phone

0 Kudos
BjornSvensson
Esri Regular Contributor

Portal 10.2.2 used JSAPI 3.8 so would not work with apps written for 3.11 or later (without a minor code change). See the important note in What's new in Version 3.11 | Guide | ArcGIS API for JavaScript .

RobinWhite
New Contributor III

Thanks! Mystery resolved, that explains it.

I developed the JavaScript and CSS working with later versions, for ArcGIS Online.  That has been kept current, references v. 3.14 and works perfectly.  Portal for our version of ArcGIS (10.2.2) was brought in later.  So (for example) a message to the effect that color.js is not found (error 404) makes sense, as it is consistent with the fact that esri/Color was added at 3.9.

Of course, it would help if I could persuade our own support staff to let us go ahead and work with 10.3.1.

best regards here

0 Kudos