Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I wanted to show my public accessible ArcGIS Online map with URL on a simple Hello World PhoneGap project with Eclipse. Eclipse threw out the following error in LogCat.

Web Console:RequestError: Unable to load file: //www.arcgis.com/sharing/rest/content/items/{MapId}?f=json status: 0 at http://serverapi.arcgisonline.com/js...3.4compact/:15

Just wondering anyone have had any successful experience with using ArcGIS Online web map with PhoneGap?

Many thanks in advance!

Cheers, Alex

share|improve this question
    
Try this serverapi.arcgisonline.com/jsapi/arcgis/3.4compact –  Sunil May 7 '13 at 12:16
    
Thanks Sunil for your quick response. However, the Html file was using exactly the same ArcGIS JS api as you pointed out: <script src="serverapi.arcgisonline.com/jsapi/arcgis/3.4compact/…;. For some reason, stackexchange omitted out "http". –  alextc May 7 '13 at 12:32
    
check out this sample help.arcgis.com/en/webapi/javascript/arcgis/jssamples/… –  Sunil May 7 '13 at 12:54
1  
I gave the samples there a go. Found the live sample worked well; but when downloaded and unzipped it to local and ran the sample locally, it threw out the same error on Chrome. "Unable to load the file... ..." Could be an Ajax issue? As it runs on Android, there will be no proxy file. Any idea? Thanks! –  alextc May 7 '13 at 13:30
add comment

1 Answer

Here is the solution:

http://forums.arcgis.com/threads/839...h-PhoneGap-2.7

esri.arcgis.utils.arcgisUrl = esri.arcgis.utils.arcgisUrl.replace("file:", "http:");

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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