<script type="text/javascript"> var dojoConfig = { baseUrl:"http://localhost/arcgis_js_api/library/3.1/jsapi/js/dojo/dojo/" }; </script>
Ah, so I was correct earlier:Please mark whichever post you think is correct as the 'answer'.Told you it was worth investigating the 'real' cause, much more satisfying than simply pasting someone else's code, don't you agree? 🙂
I identify the problem. I search baseUrl in my webapp and found this code: djConfig = { parseOnLoad:true, baseUrl: "./", isDebug:false, locale: "it", modulePaths: { "dijits": "./dijits" } };I search dojo.config and not djConfig for this i don't found. I have commented the part of baseUrl and the webapp run correctly.Thanks so much 😄This is the correct answer 😄
Please show us the path you have used to the JS API and also what you've got in your dojoConfig etc.The base URL being used to retrieve resources is incorrect, we just need to work out why.
...and exactly what have you set in your dojoConfig?
You're welcome...but it's not the complete answer. (and I was delaying posting it in the hope of finding the real cause - tricky to do remotely though!)The 'official' method should work although I think this way's better for most people and it's much simpler to explain!With the current value i.e.localhost, it will only work when the app is being accessed from the same machine on which the API resides so you either need to change the value "localhost" to be either the IP or the hostname used to access the website or if all the apps are on the same site as the API you could use a relative URL.I urge you to investigate and gain a full understanding of how URLs and paths are used in Dojo and don't accept a quick answer just because it works.Please ask if you have any further questions.(something is not right with the way that the baseUrl is being calculated in your apps, you really should find out why)
...and your app is definitely referencing the API the same way?Just humour me, put this in your application page before the script element used to load the API: <script type="text/javascript"> var dojoConfig = { baseUrl:"http://localhost/arcgis_js_api/library/3.1/jsapi/js/dojo/dojo/" }; </script>
and in the configuration i put this url:localhost/arcgis_js_api/library/3.1/jsapi/js/dojo/dojo or 192.168.13.56/arcgis_js_api/library/3.1/jsapi/js/dojo/dojo
Save the attached file (localapitest.htm) to the root of your site, in your case that appears to be C:\xampp\htdocs\The click this link:http://localhost/localapitest.htm(it's just the sample file from the API zip)What do you see?(need to zip attachement to upload)
Just to be sure...those errors are very similar to mine when I call a page with api > 3.0 with the phisycal path "file:///C:/inetpub/wwwroot/test.html" instead of "localhost/test.html". Are you calling your page in the proper way, right? In this case, are esri samples working on your webserver?
....and where is your application (web page) relative to the API?
My Arcgis Api is in:C:\xampp\htdocs\arcgis_js_api\library\3.1\jsapiand in the configuration i put this url:localhost/arcgis_js_api/library/3.1/jsapi/js/dojo/dojo or 192.168.13.56/arcgis_js_api/library/3.1/jsapi/js/dojo/dojo192.168.13.56 is my local ip in my network...
did you put your application in a webserver? It is needed from 3.0
Yes, paths need to be set - did you follow the installation instructions?
What does that screenshot tell you?
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.