0

I am new to ArcGIS javascript API and I want to use it in local host mode. I definitely follow Esri support instruction for using of it. but unfortunately i can not load it.

What do I write instead of [HOSTNAME_AND_PATH_TO_JSAPI] in init.js and dojo.js host when I want to use this library in local host mode?

replacement -> localhost/arcgis_js_api/library/3.16/3.16/

1

When you say you want to use it in local host mode what do you mean? Are you just running the application from localhost? Perhaps you should still just require the files from the CDN.

Something like this.

<script type="text/javascript">
    var dojoConfig = {
        async: true,
        parseOnLoad: false,
        packages: [
            {
                name: "application",
                location: "/App/js"
            }
        ]
    };
</script>
<script defer src="https://js.arcgis.com/3.19/"></script>
<script defer src="~/App/app.js"></script>

If you actually have the ArcGIS API local, and you want to access those files local, then just change the path from CDN path above to local path.

1

Depnding on the version hosted in your local server , in your case Ithink you've just missed to remove also dojo from the path

In 3.XX you have to replace :

[HOSTNAME_AND_PATH_TO_JSAPI]dojo by --> localhost/arcgis_js_api/library/3.16/3.16/

in both init.js and dojo.js

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.